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

Maxim Dounin mdounin at mdounin.ru
Tue Jun 6 12:35:30 UTC 2017


Hello!

On Mon, Jun 05, 2017 at 09:59:45PM -0700, Piotr Sikora via nginx-devel wrote:

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

I think it is perfectly ok to ignore this and let if force chunked 
encoding (and this is what the suggested change does).

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


More information about the nginx-devel mailing list