]> git.ipfire.org Git - thirdparty/squid.git/commit
Fixed chunked request forwarding in ICAP REQMOD presence.
authorAlex Rousskov <rousskov@measurement-factory.com>
Wed, 6 Apr 2011 16:25:36 +0000 (10:25 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Wed, 6 Apr 2011 16:25:36 +0000 (10:25 -0600)
commitf228d6f6eaebf171858a67ea8bd625255b738ded
tree29c158d7561674f6ca106911581432e683557754
parent5b44c55d55ab67a19bb27ff7df00711a74a6e4e2
Fixed chunked request forwarding in ICAP REQMOD presence.

ICAP prohibits forwarding of hop-by-hop headers in HTTP headers. If the virgin
request has a "Transfer-Encoding: chunked" header, the ICAP server will not
receive it. Thus, when the ICAP server responds with a 200 OK and what it
thinks is a copy of the HTTP request, the adapted request will be missing the
Transfer-Encoding header.

One the server side, Squid used to test whether the request had a
Transfer-Encoding header to determine whether request chunking is needed when
talking to the next HTTP hop. That test would fail in ICAP REQMOD presence.

This change implements a more direct/robust check: if we do not know the
request content length, we chunk the request.

We also no longer forward the Content-Length header if we are chunking. It
should not really be there in most cases, but an explicit check is safer and
may also prevent request smuggling attacks via Connection: Content-Length
tricks.
src/http.cc