]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: h3: skip content-length check on backend bodyless responses
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 16 Nov 2026 12:53:09 +0000 (13:53 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 16 Nov 2026 14:06:34 +0000 (15:06 +0100)
commita4298fa4f8b900146ed7d04efdc0e07a047d1a33
treeddadf8299944ff01e81652460acc9baf5fac5ceb
parent9c2b4fe87dcadb052a0495ff29d6e4ae2dfaf7f5
BUG/MINOR: h3: skip content-length check on backend bodyless responses

Some specific HTTP responses are defined as having no content but with a
possible non-null content-length header value. This is the case for the
responses to HEAD requests or responses with status 204 or 304.

Prior to this patch, such responses were considered invalid due to
h3_check_body_size(), in opposition to the recommandation of RFC 9114.
This would result in a stream reset and an error reported to the client.

Fix this by detecting these bodyless responses and with the new stream
flag H3_SF_BODYLESS_RSP. This is performed during the request emission
in h3_req_headers_send() for HEAD method and during the response parsing
in h3_resp_headers_to_htx() for 204/304 status detection.

The final part of this change is to disable the check on body size in
h3_check_body_size() when the new flag is set.

This must be backported up to 3.3.
src/h3.c