]> git.ipfire.org Git - thirdparty/squid.git/commit
Bug 2821: Ignore Content-Range in non-206 responses (#77)
authorEduard Bagdasaryan <dictiano@gmail.com>
Thu, 16 Nov 2017 00:05:21 +0000 (03:05 +0300)
committerAmos Jeffries <yadij@users.noreply.github.com>
Thu, 30 Nov 2017 08:14:04 +0000 (21:14 +1300)
commita726dfd866897022ccdac968ee4426d50b0ca61b
treec6a56efb95b5521493d5e523ca60ae0e08880941
parent5c121f716dbc04cd2f5cfd33f2bbbe31776c2168
Bug 2821: Ignore Content-Range in non-206 responses (#77)

Squid used to honor Content-Range header in HTTP 200 OK (and possibly
other non-206) responses, truncating (and possibly enlarging) some
response bodies. RFC 7233 declares Content-Range meaningless for
standard HTTP status codes other than 206 and 416. Squid now relays
meaningless Content-Range as is, without using its value.

Why not just strip a meaningless Content-Range header? Squid does not
really know whether it is the status code or the header that is "wrong".
Let the client figure it out while the server remains responsible.

Also ignore Content-Range in 416 (Range Not Satisfiable) responses
because that header does not apply to the response body.

Also fixed body corruption of (unlikely) multipart 206 responses to
single-part Range requests. Valid multipart responses carry no
Content-Range (in the primary header), which confused Squid.
src/HttpHdrRange.cc
src/HttpHeaderRange.h
src/HttpReply.cc
src/HttpReply.h
src/clients/Client.cc
src/http/Stream.cc
src/tests/stub_HttpReply.cc