From: Piotr Sikora Date: Mon, 24 Mar 2014 23:35:44 +0000 (-0700) Subject: Apply underscores_in_headers also to the first character. X-Git-Tag: release-1.5.13~22 X-Git-Url: http://www.kaiwu.me/postgresql/commit/?a=commitdiff_plain;h=ac1617915c55923f8281813e91f14997ace1b97e;p=nginx.git 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 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; }