changeset 7580:8f55cb5c7e79

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.
author Ruslan Ermilov <ru@nginx.com>
date Tue, 15 Oct 2019 14:46:10 +0300
parents 6208c5418c88
children afceb32f3a8a
files src/http/ngx_http_parse.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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;