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
index aa56b97..cfc42f9 100644
--- a/src/http/ngx_http_parse.c
+++ b/src/http/ngx_http_parse.c
@@ -912,6 +912,8 @@
i = 1;
} else {
+ hash = 0;
+ i = 0;
r->invalid_header = 1;
}
@@ -922,6 +924,8 @@
return NGX_HTTP_PARSE_INVALID_HEADER;
}
+ hash = 0;
+ i = 0;
r->invalid_header = 1;
break;