]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: http-fetch: don't report pseudo-headers in TCP mode
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 7 Oct 2026 14:35:59 +0000 (16:35 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 12 Oct 2026 13:46:14 +0000 (15:46 +0200)
commit97109ffe57831c8912c12ea7e4a5a5d8a55099da
treeb911e8703184d0b718c9ad0e70b770de10de3b74
parente8ba1113cbc5b07265f97966abf43a67081b9d06
BUG/MINOR: http-fetch: don't report pseudo-headers in TCP mode

In TCP mode, HTTP sample fetches parse the raw request found in the channel
buffer using h1_headers_to_hdr_list() before converting it to HTX. But the
H1_MF_NO_PHDR flag was not set, so the ":method" and ":path" pseudo-headers
produced by the parser were added as regular headers to the HTX
message. Thus, for "GET /x HTTP/1.1" with a single Host header, req.hdr_cnt
returns 3, req.hdrs and req.hdr_names contain ":method" and ":path", and
req.hdr(:path) returns the URI, unlike in HTTP mode. It also consumes two
header slots, so that requests with 99 or 100 headers make the fetches fail
in TCP mode while they are accepted in HTTP mode.

Let's set H1_MF_NO_PHDR for this parsing.

This was introduced by commit ef453ed9b ("MINOR: http_fetch: Add
smp_prefetch_htx") in 1.9-dev7. It may be backported to all stable versions.
src/http_fetch.c