]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: h1: forget a previous pass' results when parsing headers only
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 7 Oct 2026 14:04:50 +0000 (16:04 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 16 Oct 2026 17:10:27 +0000 (19:10 +0200)
commit2bef554cc1b26091b80ce66bbcaa87c638bead25
tree97ac5a0cd3aeb5695cb5138b0e02ca7663fd30f1
parent62bde6048d8fa60d24277659833866ad82f0dace
BUG/MINOR: h1: forget a previous pass' results when parsing headers only

In H1_MF_HDRS_ONLY mode, which is used for FCGI responses (no start-line),
h1_headers_to_hdr_list() always parses the headers again from the beginning
when it's called again after an incomplete parsing. But unlike the normal
restart path, the flags and lengths found during the previous pass were not
reset. So when the headers of an FCGI response are received in several
parts, the content-length found in the first part is seen as a duplicate
during the second pass and the header is dropped. The response is then
forwarded to the client without content-length, close-delimited, and the
client connection is closed. Similarly, "transfer-encoding: chunked" is seen
twice and reported as an error (ignored in this mode).

Let's reset the flags as on a regular restart, keeping the version and
method flags set by the caller in this mode, as well as the lengths.

This patch should be backported to all supported versions.
src/h1.c