Allow non-zero Content-Length for HEAD requests

This commit is contained in:
Ramandeep 2014-08-08 13:45:12 +05:30 committed by Felipe Zimmerle
parent c226240df9
commit 005b42548a

View File

@ -1412,7 +1412,7 @@ ngx_http_modsecurity_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
"ModSecurity: save headers out done: done");
if (r->headers_out.content_length_n != -1) {
if (r->headers_out.content_length_n != -1 && r->method != NGX_HTTP_HEAD) {
r->headers_out.content_length_n = content_length;
r->headers_out.content_length = NULL; /* header filter will set this */