Adding support for HTTP trailing headers in chunked requests

Maxim Dounin mdounin at mdounin.ru
Fri May 27 15:37:28 UTC 2016


Hello!

On Fri, May 27, 2016 at 07:35:30AM -0700, Wesley Pereira wrote:

> Are there any plans to support HTTP trailing headers in chunked 
> requests as per 
> https://tools.ietf.org/html/rfc2616#section-3.6.1?

No, there are no plans.

> If not, we would be interested in sending a patch for adding 
> support. It looks like we would modify ngx_http_parse_chunked 
> and refactor ngx_http_parse_header_line so we can reuse it for 
> parsing trailing headers. And then have a directive to whitelist 
> which trailing headers to allow.
> When the request is proxied upstream, if it’s fully buffered we 
> could add the trailing header as a request header. If it’s 
> unbuffered, then just proxy them as trailing headers. And we 
> would only include the whitelisted headers.
> 
> Does this sound like a reasonable approach? What are the chances 
> of accepting such a patch.

It's not clear how do you expect it to be used.  As far as I know, 
trailers are not used in the real world applications.

And, obviously, any attempt to use/support trailers should be well 
tought from security point of view.  The whole idea of trailers 
looks like a security nightmare.

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



More information about the nginx-devel mailing list