]> git.kaiwu.me - haproxy.git/commit
REGTESTS: http-messaging: test reject-unexpected-request-upgrade
authorWilly Tarreau <w@1wt.eu>
Wed, 25 Nov 2026 18:07:51 +0000 (18:07 +0000)
committerWilly Tarreau <w@1wt.eu>
Wed, 25 Nov 2026 18:31:09 +0000 (19:31 +0100)
commitffb76d3535c40b6b80c9ca97c3a6a84e576523ba
tree1d27062d04954486ba34406a7b8ae3f5bea7c9e1
parenta9a5154133370c365c18ae3d20347a904b977ad4
REGTESTS: http-messaging: test reject-unexpected-request-upgrade

This adds the "reject-unexpected-request-upgrade" check to the HTTP/1
and H2 tests, in its own profile on its own bind line, and an upgrade
to an unknown protocol to the reference connection which has everything
off. Only "websocket" and "webtransport" are kept in the Upgrade header,
which is removed along with "connection: upgrade" once empty, and the
request is not rejected. The frontend now also reports the Upgrade
header in "x-upg". For H2, this is done via extended CONNECT, which is
accepted for "websocket" and "webtransport" and rejected for other
protocols. For websocket, the server is a frontend of the same instance
which computes the Sec-WebSocket-Accept header that haproxy verifies,
as done in websocket.vtc.
reg-tests/http-messaging/http_hardening_h1.vtc
reg-tests/http-messaging/http_hardening_h2.vtc