]> git.kaiwu.me - haproxy.git/commit
BUG/MEDIUM: mux-h1: don't send chunked responses to HTTP/1.0 clients
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 7 Oct 2026 14:05:00 +0000 (16:05 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 16 Oct 2026 17:10:27 +0000 (19:10 +0200)
commitbdc4b82d16a87c1b730c2565bf5c3fdd4a46b976
tree8562334622f8b19986402c53f11698606f2add13
parent2bef554cc1b26091b80ce66bbcaa87c638bead25
BUG/MEDIUM: mux-h1: don't send chunked responses to HTTP/1.0 clients

When a response without content-length is sent to an H1 client, the chunked
transfer-coding is added if the response is in HTTP/1.1, and a chunked
response is forwarded as-is. But the version which matters here is the
request's one: the chunked transfer-coding must not be sent in a response to
an HTTP/1.0 request (RFC9112#6.1), since such a client doesn't know about
it.

Now, on the frontend side, when the request was not HTTP/1.1 and the
response has a body without content-length, it is switched to an unknown
transfer length: no transfer-encoding header is emitted, the payload is sent
close-delimited (trailers are dropped) and the close mode is forced. For
bodyless responses (HEAD, 204, 304), only the transfer-encoding header is
removed.

A reg-test was added for this.

This patch must be backported to all supported versions.
reg-tests/http-messaging/h1_chunked_resp_to_http10.vtc [new file with mode: 0644]
src/mux_h1.c