]> git.kaiwu.me - haproxy.git/commit
MEDIUM: http-fetch: Rework how HTTP message version is retrieved
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 25 Feb 2026 15:20:56 +0000 (16:20 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 5 Mar 2026 14:34:46 +0000 (15:34 +0100)
commitb2ba3c666202706fd2602f1bda4e4067034d04cc
treeaffc6f7adce88622695cdfbc9098a6e08a62e932
parent7bfb66d2b1a361db824cf4e809a094f09d166acc
MEDIUM: http-fetch: Rework how HTTP message version is retrieved

Thanks to previous patches, we can now rely on the version stored in the
http_msg structure to get the request or the response version.

"req.ver" and "res.ver" sample fetch functions returns the string
representation of the version, without the prefix, so "<major>.<minor>", but
only if the version is valid. For the response, "res.ver" may be added from
a health-check context, in that case, the HTX message is used.

"capture.req.ver" and "capture.res.ver" does the same but the "HTTP/" prefix
is added to the result. And "capture.res.ver" cannot be called from a
health-check.

To ease the version formatting and avoid code duplication, an helper
function was added. So these samples are now relying on "get_msg_version()".
doc/configuration.txt
src/http_fetch.c