]> git.kaiwu.me - haproxy.git/commit
BUG/MEDIUM: http-htx: normalize Host header carrying the scheme's default port
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 24 Nov 2026 10:19:45 +0000 (11:19 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 26 Nov 2026 06:32:21 +0000 (07:32 +0100)
commit548f1c4daef843cb9abd3378c4ec87808972787d
tree24d2f1672ad6a355d0556b57cf858257aeec57f3
parenta8e8ab1447dab511e73cc00a95e17d0131b01055
BUG/MEDIUM: http-htx: normalize Host header carrying the scheme's default port

An HTTP/1 absolute-form request-target whose authority carries no port may
be sent with a Host header value carrying the scheme's default port (or an
empty one). h1_validate_mismatch_authority() deliberately accepts both
spellings as equivalent, but http_scheme_based_normalize() only removed the
port when it was found in the URI authority, so the raw ":443" remained in
the Host header value.

As a result the ACLs, the routing rules and the cache key were evaluated on
different values and this could be confusing.

Now the Host header value is also normalized when it carries the scheme's
default port and matches the authority, so the analyser, the rules, the
cache and the forwarded request all see the same canonical host value.

Thanks to Christos Papakonstantinou for the report.

This patch could be backported to stable versions. But it could be good to
wait for a period of observation first.
reg-tests/http-messaging/h1_host_normalization.vtc
src/http_htx.c