Skip to content

Commit 3a8c08a

Browse files
committed
fixed build faile, remove path information of response body
1 parent 2e77cf3 commit 3a8c08a

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

ngx_cache_purge_module.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ static size_t ngx_http_cache_purge_content_type_html_size = sizeof(ngx_http_cach
5252
static size_t ngx_http_cache_purge_content_type_xml_size = sizeof(ngx_http_cache_purge_content_type_xml);
5353
static size_t ngx_http_cache_purge_content_type_text_size = sizeof(ngx_http_cache_purge_content_type_text);
5454

55-
static const char ngx_http_cache_purge_body_templ_json[] = "{\"Key\": \"%s\",\"Path\": \"%s\"}";
56-
static const char ngx_http_cache_purge_body_templ_html[] = "<html><head><title>Successful purge</title></head><body bgcolor=\"white\"><center><h1>Successful purge</h1><br>Key : %s<br>Path : %s</center></body></html>";
57-
static const char ngx_http_cache_purge_body_templ_xml[] = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><status><Key><![CDATA[%s]]></Key><Path><![CDATA[%s]]></Path></status>";
58-
static const char ngx_http_cache_purge_body_templ_text[] = "Key:%s\nPath:%s\n";
55+
static const char ngx_http_cache_purge_body_templ_json[] = "{\"Key\": \"%s\"}";
56+
static const char ngx_http_cache_purge_body_templ_html[] = "<html><head><title>Successful purge</title></head><body bgcolor=\"white\"><center><h1>Successful purge</h1><br>Key : %s</center></body></html>";
57+
static const char ngx_http_cache_purge_body_templ_xml[] = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><status><Key><![CDATA[%s]]></Key></status>";
58+
static const char ngx_http_cache_purge_body_templ_text[] = "Key:%s\n";
5959

6060
static size_t ngx_http_cache_purge_body_templ_json_size = sizeof(ngx_http_cache_purge_body_templ_json);
6161
static size_t ngx_http_cache_purge_body_templ_html_size = sizeof(ngx_http_cache_purge_body_templ_html);
@@ -1538,7 +1538,9 @@ ngx_http_cache_purge_send_response(ngx_http_request_t *r) {
15381538
return NGX_HTTP_INTERNAL_SERVER_ERROR;
15391539
}
15401540

1541-
p = ngx_snprintf(buf, resp_tmpl_len, resp_body , buf_keydata, r->cache->file.name.data);
1541+
1542+
//p = ngx_snprintf(buf, resp_tmpl_len, resp_body , buf_keydata, r->cache->file.name.data);
1543+
p = ngx_snprintf(buf, resp_tmpl_len, resp_body , buf_keydata, buf_keydata);
15421544
if (p == NULL) {
15431545
return NGX_HTTP_INTERNAL_SERVER_ERROR;
15441546
}
@@ -1572,7 +1574,6 @@ ngx_http_cache_purge_send_response(ngx_http_request_t *r) {
15721574
return rc;
15731575
}
15741576

1575-
15761577
return ngx_http_output_filter(r, &out);
15771578
}
15781579

t/resptype1.t

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ PURGE /purge_json/proxy/passwd?t=7
178178
--- error_code: 200
179179
--- response_headers
180180
Content-Type: application/json
181-
--- response_body_like: {\"Key\": \"\/proxy\/passwd\?t=7\",\"Path\": \"\/tmp\/ngx_cache_purge_cache\/
181+
--- response_body_like: {\"Key\": \"\/proxy\/passwd\?t=7\"
182182
--- timeout: 10
183183
--- no_error_log eval
184184
qr/\[(warn|error|crit|alert|emerg)\]/
@@ -207,7 +207,7 @@ PURGE /purge_xml/proxy/passwd?t=8
207207
--- error_code: 200
208208
--- response_headers
209209
Content-Type: text/xml
210-
--- response_body_like: \<\?xml version=\"1.0\" encoding=\"UTF-8\"\?><status><Key><\!\[CDATA\[\/proxy\/passwd\?t=8\]\]><\/Key><Path><\!\[CDATA\[\/tmp\/ngx_cache_purge_cache\/
210+
--- response_body_like: \<\?xml version=\"1.0\" encoding=\"UTF-8\"\?><status><Key><\!\[CDATA\[\/proxy\/passwd\?t=8\]\]><\/Key>
211211
--- timeout: 10
212212
--- no_error_log eval
213213
qr/\[(warn|error|crit|alert|emerg)\]/

0 commit comments

Comments
 (0)