From: Ruslan Ermilov Date: Tue, 15 Oct 2019 11:46:10 +0000 (+0300) Subject: Fixed header parsing with ignore_invalid_headers switched off. X-Git-Tag: release-1.17.5~7 X-Git-Url: http://git.kaiwu.me/postgresql/log/contrib/postgres_fdw/postgres_fdw.c?a=commitdiff_plain;h=3c84e4b70584b78e6a34a3233465cfa99d26b107;p=nginx.git 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 aa56b976d..cfc42f9dd 100644 --- 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_request_t *r, ngx_buf_t *b, i = 1; } else { + hash = 0; + i = 0; r->invalid_header = 1; } @@ -922,6 +924,8 @@ ngx_http_parse_header_line(ngx_http_request_t *r, ngx_buf_t *b, return NGX_HTTP_PARSE_INVALID_HEADER; } + hash = 0; + i = 0; r->invalid_header = 1; break;