From 005b42548ab0a4e04bdd59c35c16d07a5d01850d Mon Sep 17 00:00:00 2001 From: Ramandeep Date: Fri, 8 Aug 2014 13:45:12 +0530 Subject: [PATCH] Allow non-zero Content-Length for HEAD requests --- nginx/modsecurity/ngx_http_modsecurity.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx/modsecurity/ngx_http_modsecurity.c b/nginx/modsecurity/ngx_http_modsecurity.c index 1fac4f55..e4e2a2c3 100644 --- a/nginx/modsecurity/ngx_http_modsecurity.c +++ b/nginx/modsecurity/ngx_http_modsecurity.c @@ -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 */