# HG changeset patch # User Ruslan Ermilov # Date 1571139970 -10800 # Node ID 8f55cb5c7e795e26c040a33c43e0074e5fddf63c # Parent 6208c5418c88ce8ecc656b40704a752cb7c7648a Fixed header parsing with ignore_invalid_headers switched off. The parsing was broken when the first character of the header name was invalid. Based on a patch by Alan Kemp. diff --git a/src/http/ngx_http_parse.c b/src/http/ngx_http_parse.c --- a/src/http/ngx_http_parse.c +++ b/src/http/ngx_http_parse.c @@ -912,6 +912,8 @@ ngx_http_parse_header_line(ngx_http_requ i = 1; } else { + hash = 0; + i = 0; r->invalid_header = 1; } @@ -922,6 +924,8 @@ ngx_http_parse_header_line(ngx_http_requ return NGX_HTTP_PARSE_INVALID_HEADER; } + hash = 0; + i = 0; r->invalid_header = 1; break;