]> git.kaiwu.me - haproxy.git/commit
MEDIUM: checks: Support matching on headers for http-check expect rules
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 5 May 2020 08:47:36 +0000 (10:47 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 5 May 2020 09:19:27 +0000 (11:19 +0200)
commit3970819a550a78eb8e88c47fdf0516f9777a91fd
treeba45952a4cff2a62745f54378170bc2ceb104cd0
parentcb436f0c291c716fea5162adf5b111c5ddc9cc3b
MEDIUM: checks: Support matching on headers for http-check expect rules

It is now possible to add http-check expect rules matching HTTP header names and
values. Here is the format of these rules:

  http-check expect header name [ -m <meth> ] <name> [log-format] \
                           [ value [ -m <meth> ] <value> [log-format] [full] ]

the name pattern (name ...) is mandatory but the value pattern (value ...) is
optionnal. If not specified, only the header presence is verified. <meth> is the
matching method, applied on the header name or the header value. Supported
matching methods are:

  * "str" (exact match)
  * "beg" (prefix match)
  * "end" (suffix match)
  * "sub" (substring match)
  * "reg" (regex match)

If not specified, exact matching method is used. If the "log-format" option is
used, the pattern (<name> or <value>) is evaluated as a log-format string. This
option cannot be used with the regex matching method. Finally, by default, the
header value is considered as comma-separated list. Each part may be tested. The
"full" option may be used to test the full header line. Note that matchings are
case insensitive on the header names.
doc/configuration.txt
include/types/checks.h
reg-tests/checks/http-check-expect.vtc [new file with mode: 0644]
src/checks.c