aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_parse.c
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@nginx.com>2019-10-15 14:46:10 +0300
committerRuslan Ermilov <ru@nginx.com>2019-10-15 14:46:10 +0300
commit3c84e4b70584b78e6a34a3233465cfa99d26b107 (patch)
tree9d2c7bad5f8309cf77f02c222fcea9dd2d73d55b /src/http/ngx_http_parse.c
parent85137dd2a639bea7424f742cdebd9773ce7a2081 (diff)
downloadnginx-3c84e4b70584b78e6a34a3233465cfa99d26b107.tar.gz
nginx-3c84e4b70584b78e6a34a3233465cfa99d26b107.zip
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.
Diffstat (limited to 'src/http/ngx_http_parse.c')
-rw-r--r--src/http/ngx_http_parse.c4
1 files changed, 4 insertions, 0 deletions
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;