]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: mux-h2: only convert GET upgrade requests to Extended CONNECT
authorWilly Tarreau <w@1wt.eu>
Wed, 7 Oct 2026 14:21:44 +0000 (16:21 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 9 Nov 2026 19:48:35 +0000 (20:48 +0100)
commit8a7a4466c51423a7b06319c85f7939ca1baa04b4
treef4ba0dc8637a92b970c1d3f923de05d416498739
parentc5e93986efab35b44989c02446b08309a20a6d86
BUG/MINOR: mux-h2: only convert GET upgrade requests to Extended CONNECT

An H1 request carrying "Connection: upgrade" sent to an H2 server is
converted to an Extended CONNECT (RFC8441) whatever its method, while
RFC8441 only defines GET requests, and an Extended CONNECT received by
haproxy on the H2 side is always converted back to a GET. So through an
H2 hop (H1 -> haproxy -> h2 -> haproxy -> H1 server), a bodyless DELETE,
OPTIONS, POST or PUT request with an upgrade reaches the server as a GET
(bodies are rejected however). There's no direct implication to this but
it could at least be confusing, and maybe cause trouble in certain cases
(idempotent methods, HEAD etc).

Let's reject the conversion for methods other than GET, like it is
already done for upgrade requests with a payload since commit 001fb1a54
("BUG/MEDIUM: mux-h1/mux-h2: Reject upgrades with payload on H2 side
only"). This way we don't block them in H1 where they are supported
(and used as shown in the commit above).

The protocol_upgrade reg-test was extended to check that a bodyless
DELETE upgrade request is rejected instead of reaching the server
as a GET.

This could be backported to all stable versions.
reg-tests/http-messaging/protocol_upgrade.vtc
src/mux_h2.c