[PATCH 3 of 3] Headers filter: added "add_trailer" directive

Piotr Sikora piotrsikora at google.com
Tue Jun 6 04:59:45 UTC 2017


Hey Maxim,

> It doesn't look like "if (h[i].value.value.len)" is needed here.
> It is either true, or the "add_trailer" directive is nop and we
> already know this while parsing the configuration.
>
> -            if (h[i].value.value.len) {
> -                r->expect_trailers = 1;
> -                break;
> -            }
> +            r->expect_trailers = 1;
> +            break;

Well, both "add_header" and "add_trailer" allow setting something like:

    add_trailer Empty "";

which will get added to headers / trailers list.

I've added this extra check to avoid forcing chunked encoding with
such configuration.

Maybe we should reject it during configuration instead, or ignore this
case and let it force chunked encoding? Which one do you prefer?

Best regards,
Piotr Sikora


More information about the nginx-devel mailing list