Skip to content

Commit 4c711cc

Browse files
RamandeepFelipe Zimmerle
Ramandeep
authored and
Felipe Zimmerle
committed
Allow non-zero Content-Length for HEAD requests
1 parent 1a24474 commit 4c711cc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

nginx/modsecurity/ngx_http_modsecurity.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1412,7 +1412,7 @@ ngx_http_modsecurity_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
14121412
"ModSecurity: save headers out done: done");
14131413

14141414

1415-
if (r->headers_out.content_length_n != -1) {
1415+
if (r->headers_out.content_length_n != -1 && r->method != NGX_HTTP_HEAD) {
14161416

14171417
r->headers_out.content_length_n = content_length;
14181418
r->headers_out.content_length = NULL; /* header filter will set this */

0 commit comments

Comments
 (0)