# HG changeset patch # User Piotr Sikora # Date 1395704144 25200 # Node ID bd91f286ee0ade98e9c0f8f55bfef54a122adaf2 # Parent d0e75244a18a1f381e620ce149b0f3d223461e4c Apply underscores_in_headers also to the first character. Signed-off-by: Piotr Sikora diff --git a/src/http/ngx_http_parse.c b/src/http/ngx_http_parse.c --- 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_requ 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; }