mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-03-14 19:41:33 +01:00
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()".