]> git.ipfire.org Git - thirdparty/squid.git/commit
Do not send chunked requests without a "Transfer-Encoding: chunked" header
authorAlex Rousskov <rousskov@measurement-factory.com>
Tue, 14 Sep 2010 07:45:30 +0000 (01:45 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Tue, 14 Sep 2010 07:45:30 +0000 (01:45 -0600)
commite31a1e670852dc9b16b3b8d17bccbf09b63c3da5
treeb4ada4b526b917af7129af994208425414617c8c
parent386c7842cbff563b2ed54878c28d555485001fb5
Do not send chunked requests without a "Transfer-Encoding: chunked" header
or with a "Content-Length: 0" header.

Whether we are sending a chunked request depends not just on whether the
received request was chunked (condition A) but also on whether we still do not
know the request body size (condition B). The old code added the
"Transfer-Encoding: chunked" header if (A && B) but chunked the request body
if (A). This resulted in malformed requests with chunked request bodies but
without the "Transfer-Encoding: chunked" header.

When adding the Transfer-Encoding field, the old code also considered zero
Content-Length as "unknown", which was, apparently wrong. This resulted in the
"Content-Length: 0" header sent with a chunked encoded [empty] body, violating
HTTP rules. I am not 100% sure we never use zero request->content_length value
to mark "unknown" length though, so this may need more work.

based on lp 3p2-plus branch, r10827.
src/http.cc
src/structs.h