From ac1617915c55923f8281813e91f14997ace1b97e Mon Sep 17 00:00:00 2001 From: Piotr Sikora Date: Mon, 24 Mar 2014 16:35:44 -0700 Subject: Apply underscores_in_headers also to the first character. Signed-off-by: Piotr Sikora --- src/http/ngx_http_parse.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src') diff --git a/src/http/ngx_http_parse.c b/src/http/ngx_http_parse.c index 8c1a62a7b..02b4a0fd1 100644 --- a/src/http/ngx_http_parse.c +++ b/src/http/ngx_http_parse.c @@ -886,6 +886,19 @@ ngx_http_parse_header_line(ngx_http_request_t *r, ngx_buf_t *b, break; } + if (ch == '_') { + if (allow_underscores) { + hash = ngx_hash(0, ch); + r->lowcase_header[0] = ch; + i = 1; + + } else { + r->invalid_header = 1; + } + + break; + } + if (ch == '\0') { return NGX_HTTP_PARSE_INVALID_HEADER; } -- cgit