]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: mux-h1: reset the content-length/chunking state after a 1xx response
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 7 Oct 2026 09:26:21 +0000 (11:26 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 16 Oct 2026 17:10:27 +0000 (19:10 +0200)
commit5c1d1652fc7db9a731c90bb21642f07577fcbcf1
tree5f9277ed6853dbe6391b8452a80e85880dbc806a
parentf3aa948606e188a3b72dd0f1407fa91397aba2cf
BUG/MINOR: mux-h1: reset the content-length/chunking state after a 1xx response

Since commit a6b32922f ("MINOR: mux-h1: Keep custom "Content-Length: 0"
header in 1xx and 204 messages"), h1_make_headers() emits a
"content-length: 0" header found in a 1xx response and marks it as emitted
with H1S_F_HAVE_CLEN. But once the 1xx response is sent, h1_make_eoh() resets
the response state for the final response and only clears H1S_F_HAVE_O_CONN.
H1S_F_HAVE_CLEN remains set, so the final response's content-length header
is either considered as a duplicate and compared to the reset body length
(0), which makes the response fail with a processing error after its status
line was sent if it is not 0, or skipped when it is 0, leaving a keep-alive
response without any length. H1S_F_HAVE_CHNK could be affected the same way.

The H1 parser drops content-length from 1xx responses, so this can only
happen with servers using another protocol (e.g. H2), which may send it
despite RFC9110 forbidding it.

Now both flags are reset with H1S_F_HAVE_O_CONN after a 1xx response.

A reg-test was added to verify this.

This must be backported wherever commit a6b32922f was backported, so as far
as 3.2.
reg-tests/http-messaging/h2_1xx_clen_to_h1.vtc [new file with mode: 0644]
src/mux_h1.c