]> git.ipfire.org Git - thirdparty/squid.git/commit - src/HttpReply.cc
Compliance: remove Content-Length header if Transfer-Encoding is present.
authorAlex Rousskov <rousskov@measurement-factory.com>
Tue, 24 Aug 2010 04:18:51 +0000 (22:18 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Tue, 24 Aug 2010 04:18:51 +0000 (22:18 -0600)
commitc3d0ba0c0522ec460dd8ebf1af38f432ddba71c8
tree4d54d4052bce0cc5c42559affaff3ac36e89b3e7
parente18b8316f02564f2616e5509a64daf5590b0bb41
Compliance: remove Content-Length header if Transfer-Encoding is present.

If after HTTP header parsing we have both "Transfer-Encoding: chunked"
and Content-Length headers, remove the Content-Length entry. The
adjusted behavior follows httpbis recommendations (ticket #95, part 2).

The old client-side code forwarded the original Content-Length header
which did not match the [dechunked] response, resulting in a malformed
response.

HttpHeader::chunked() method added to check if HTTP headers contain
chunked Transfer-Encoding header. Use this method in code that checks
for chunked encoding.

Co-Advisor test cases: test_case/rfc2616/chunked-1p0-badClen-toClt
                       test_case/rfc2616/chunked-1p1-badClen-toClt
src/HttpHeader.cc
src/HttpHeader.h
src/HttpReply.cc
src/HttpRequest.cc
src/client_side.cc
src/http.cc