BUG/MINOR: http-client: Reject any 101-switching-protocols response
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 8 Jul 2025 06:57:16 +0000 (08:57 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 1 Oct 2025 13:42:47 +0000 (15:42 +0200)
commit7847ff21b075392279104e09840294d093b368bf
tree9c5a3c1cad3326ccaf5e22ea5f40b2dbfce8765d
parent552ea76e0b3e51a2df9d4d2244ad367095dbf1dd
BUG/MINOR: http-client: Reject any 101-switching-protocols response

Protocol updages are not supported by the http-client. So report an error is
a 101-switching-protocols response is received. Of course, it is unexpected
because the API is not designed to support upgrades. But it is better to
properly handle this case.

This patch could be backported as far as 2.6. It depends on the commit
"BUG/MINOR: http-client: Ignore 1XX interim responses in non-HTX mode".

(cherry picked from commit 8ba754108d70d25d796e3dc166155503aab180b2)
Signed-off-by: Amaury Denoyelle <adenoyelle@haproxy.com>
(cherry picked from commit 0bfaef56d630a355d85fcdf2b733e479fee8595b)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 31ff75c23d25eb6b10dbe9f1af09e63083428df2)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/http_client.c