Welcome! Log In Create A New Profile

Advanced

[nginx] Apply underscores_in_headers also to the first character.

Maxim Dounin
March 25, 2014 12:16PM
details: http://hg.nginx.org/nginx/rev/bd91f286ee0a
branches:
changeset: 5624:bd91f286ee0a
user: Piotr Sikora <piotr@cloudflare.com>
date: Mon Mar 24 16:35:44 2014 -0700
description:
Apply underscores_in_headers also to the first character.

Signed-off-by: Piotr Sikora <piotr@cloudflare.com>

diffstat:

src/http/ngx_http_parse.c | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)

diffs (23 lines):

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;
}

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Apply underscores_in_headers also to the first character.

Maxim Dounin 849 March 25, 2014 12:16PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 278
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready