]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: mux-h2: don't reject an empty DATA frame ending a bodyless response
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 3 Dec 2026 14:04:43 +0000 (15:04 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 4 Dec 2026 13:53:05 +0000 (14:53 +0100)
commita7133aa892292c5271b04da59bbdb191d97d9876
treef196f555118799c61698599c559c3e80a0eb7411
parente2fd957dce9e9f86bad5e8c9282ebde4b4bd6709
BUG/MINOR: mux-h2: don't reject an empty DATA frame ending a bodyless response

On the backend side, a HEAD response (or a 204/304) may announce a
content-length and be ended by an empty DATA frame with the END_STREAM
flag. It is valid (RFC 9113 #8.1.1). But h2c_handle_data() reported "ES
on DATA frame before content-length" in this case: the stream was reset
with a PROTOCOL_ERROR, a glitch was counted and the stream protocol
errors counter was incremented. The response itself was properly
forwarded because h2_frt_transfer_data() already handled this case.
However, with "tune.h2.be.glitches-threshold", a compliant server could
lose its connection.

Now, like for the END_STREAM flag on the HEADERS frame, the content-length
check is skipped for bodyless responses on the backend side.

The reg-test http_bodyless_response.vtc was extended to check the stream
protocol errors counter of the H2 backend. The HEAD responses received from
the H2 server were already in this case.

This patch should be backported to all stable versions.
reg-tests/http-messaging/http_bodyless_response.vtc
src/mux_h2.c