]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: http-htx: Don't by-pass HTX API when merging cookie values master
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 2 Jul 2026 09:48:32 +0000 (11:48 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 2 Jul 2026 15:03:54 +0000 (17:03 +0200)
commitf3411cb734bb9ada5c764b11f6c92a9406773de7
tree8cbe3b33b33be62a7de38d36becc9e5f324b9475
parente237b4ff9fa4190f79165b58991e82e3dec77d3a
BUG/MINOR: http-htx: Don't by-pass HTX API when merging cookie values

http_cookie_merge() function is responsible to add a cookie header and merge
all values from a list. However, it was performed by appending values by
hand, using the pointer to the header value and changing the block
length. This was totally by-passing the HTX API.

For now, there is now bug because the function is called by h2 and quic
muxes when a HTTP message is parsed. And the cookie header is the last one
inserted. The HTX message is never fragmented and data from other blocs
cannot be overwritten. But, it could be an issue if it is called in another
context, from the HTTP analysis for instance.

To fix the issue, the function now relies on htx_replace_blk_value()
function to add the value separator first and then a cookie value.

This patch must be backported as far as 2.6.
src/http_htx.c