Welcome! Log In Create A New Profile

Advanced

Re: [PATCH] Parse: underscores_in_headers should apply to the first character as well

Maxim Dounin
March 21, 2014 01:14PM
Hello!

On Wed, Mar 19, 2014 at 06:56:10PM -0700, Piotr Sikora wrote:

> # HG changeset patch
> # User Piotr Sikora <piotr@cloudflare.com>
> # Date 1395280497 25200
> # Wed Mar 19 18:54:57 2014 -0700
> # Node ID 51d996a6bc65c4ca3c6621e4ad18235e6aa26abe
> # Parent c15350f4071c0207cdffbc8bbb3f28e8e57f4d86
> Parse: underscores_in_headers should apply to the first character as well.

In no particular order:

- the "Parse:" prefix isn't something we use, it may be good idea
to avoid id;

- please keep summary line short to avoid "hg log" wrapping, see
http://nginx.org/en/docs/contributing_changes.html;

- is it something really needed in practice?

>
> Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
>
> diff -r c15350f4071c -r 51d996a6bc65 src/http/ngx_http_parse.c
> --- a/src/http/ngx_http_parse.c Wed Mar 19 19:30:09 2014 +0400
> +++ b/src/http/ngx_http_parse.c Wed Mar 19 18:54:57 2014 -0700
> @@ -886,6 +886,19 @@ ngx_http_parse_header_line(ngx_http_requ
> break;
> }
>
> + if (ch == '_') {
> + if (allow_underscores) {
> + hash = ngx_hash(hash, ch);

Should be

hash = ngx_hash(0, ch);

instead.

> + 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

--
Maxim Dounin
http://nginx.org/

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

[PATCH] Parse: underscores_in_headers should apply to the first character as well

Piotr Sikora 683 March 19, 2014 09:58PM

Re: [PATCH] Parse: underscores_in_headers should apply to the first character as well

Maxim Dounin 327 March 21, 2014 01:14PM

Re: [PATCH] Parse: underscores_in_headers should apply to the first character as well

Piotr Sikora 319 March 24, 2014 07:50PM

Re: [PATCH] Parse: underscores_in_headers should apply to the first character as well

Maxim Dounin 354 March 25, 2014 12:16PM



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

Online Users

Guests: 144
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