diff options
author | Piotr Sikora <piotr@cloudflare.com> | 2014-03-24 16:35:44 -0700 |
---|---|---|
committer | Piotr Sikora <piotr@cloudflare.com> | 2014-03-24 16:35:44 -0700 |
commit | ac1617915c55923f8281813e91f14997ace1b97e (patch) | |
tree | 619e44227023dcb1f3ce34f90dad021a589cfe2f /src/http/ngx_http_parse.c | |
parent | b1597fe2eabf2ebc09a6349c5c2de1672e7580c7 (diff) | |
download | nginx-ac1617915c55923f8281813e91f14997ace1b97e.tar.gz nginx-ac1617915c55923f8281813e91f14997ace1b97e.zip |
Apply underscores_in_headers also to the first character.
Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
Diffstat (limited to 'src/http/ngx_http_parse.c')
-rw-r--r-- | src/http/ngx_http_parse.c | 13 |
1 files changed, 13 insertions, 0 deletions
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; } |