BUG/MINOR: h3: don't insert more than one Host header
authorWilly Tarreau <w@1wt.eu>
Fri, 16 May 2025 12:51:13 +0000 (14:51 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 20 May 2025 14:45:40 +0000 (16:45 +0200)
commitfd54c8ce6fb977e4591b73f677caf5743964bb45
tree264d8b13aefd9345ca1563ecab491fb36f936e93
parent718ba9f5af5e29d67e674c9af85ed89dcbb2b251
BUG/MINOR: h3: don't insert more than one Host header

Let's make sure we drop extraneous Host headers after having compared
them. That also works when :authority was already present. This way,
like for h1 and h2, we only keep one copy of it, while still making
sure that Host matches :authority. This way, if a request has both
:authority and Host, only one Host header will be produced (from
:authority). Note that due to the different organization of the code
and wording along the evolving RFCs, here we also check that all
duplicates are identical, while h2 ignores them as per RFC7540, but
this will be re-unified later.

This should be backported to stable versions, at least 2.8, though
thanks to the existing checks the impact is probably nul.

(cherry picked from commit b84762b3e0c0e7708ddc98ae6b721ed10dc1be30)
Signed-off-by: Willy Tarreau <w@1wt.eu>
src/h3.c