]> git.ipfire.org Git - thirdparty/squid.git/commit - CONTRIBUTORS
Update Host, Via, and other headers in-place when possible (#1203)
authorEric Walters <walters.w.eric@gmail.com>
Fri, 9 Dec 2022 05:58:43 +0000 (05:58 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Fri, 9 Dec 2022 05:58:46 +0000 (05:58 +0000)
commit05ba40fc1059ffe75c9a15a4e0c2923eca6801b2
treed6fc58ed3bf779ac4182eadb6ec79a561c627b74
parente85b789466dbd67d4ce3e020a6a261cb020a5585
Update Host, Via, and other headers in-place when possible (#1203)

This change optimizes Host header synchronization code that usually does
not need to change the Host header field but was always deleting the old
field and generating/appending a new one. Appending Host also violated
an RFC 9110 section 7.2 rule (on behalf of the user agent whose Host we
were rewriting): "A user agent that sends Host SHOULD send it as the
first field in the header section".

Also, removing old header fields and appending new ones introduced HTTP
header changes that broke otherwise working peers. For example, some
origins denied Squid-proxied messages exclusively due to an unusual
(from those origins point of view) Host header position. This change
reduces (but does not eliminate) such unnecessary and risky changes.
CONTRIBUTORS
src/HttpHeader.cc
src/HttpHeader.h
src/errorpage.cc
src/servers/FtpServer.cc
src/servers/Http1Server.cc
src/tests/stub_HttpHeader.cc