]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: tcpcheck: Add support for an option host header value for httpchk option
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 1 Oct 2024 16:40:40 +0000 (18:40 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 2 Oct 2024 08:22:51 +0000 (10:22 +0200)
commit27ee2927313aee25f83cf4173ccf2c4e14d58738
tree672312119445ef1c0ecd6b3e694fbf74a4c073f5
parentc39c351a737e55d78ad138474cb35331f678e311
MINOR: tcpcheck: Add support for an option host header value for httpchk option

Support for headers and body hidden in the version for the "option httpchk"
directive was removed. However a Host header is mandatory for HTTP/1.1
requests and some servers may return an error if it is not set. For now, to
add it, an "http-check send" rule must be added. But it is not really handy
to use an extra config line for this purpose.

So now, it is possible to set the host header value, a log-format string, as
extra argument to "option httpchk" directive. It must be the fourth argument:

  option httpchk GET / HTTP/1.1 www.srv.com

While this patch is not a bug fix, it is simple enough to be backported if
necessary. On 2.9 and older, lf_init_expr() does not exist and LIST_INIT() must
be used instead.
doc/configuration.txt
reg-tests/checks/http-check.vtc
src/tcpcheck.c