On Fri, Jun 04, 2004 at 01:48:31AM +0200, Graham Leggett wrote: > Mathias Herberts wrote: > > >What is the position of the Apache community on the passing of 'hop by > >hop' headers to origin servers by mod_proxy? The code in proxy_http.c > >says 'RFC2616 13.5.1 says we should strip these headers', but RFC 2616 > >13.5.1 defines 'Hop-by-hop headers, which are meaningful only for a > >single transport-level connection, and are not stored by caches or > > forwarded by proxies.' it never uses SHOULD or MUST as described in RFC > >2119 and therefore allowing mod_proxy to forward the 'Transfer-Encoding' > >header would not, IMHO, violate RFC 2616 13.5.1. > > The purpose of hop by hop headers are exactly that - they govern the > connection between each hop. Passing chunked encoding from the origin > server unchanged through the filter stack will break all the filters in > the chain, which are expecting raw data. > > The correct fix for this is to make sure that any traffic that apache > passes through in either direction is _rechunked_ if a) the connection > is HTTP/1.1 and b) there is no content length on the request.
By "there is no content length" you really mean "there is a chunked request body"? HEAD has code to send a chunked request body, but only if explicitly configured to do so. I think the correct approach is for the proxy to send a chunked request body iff the client sent a chunked request body. 2616 presumably requires that the proxy not do this if it knows that the next-hop server is not HTTP/1.1 compliant (it could return a 411 instead rather than buffer the body), but I don't think mod_proxy remembers that at the moment. joe
