]> git.kaiwu.me - haproxy.git/commit
REGTESTS: sample_fetches: add a test for the HTTP request fetches
authorWilly Tarreau <w@1wt.eu>
Mon, 21 Sep 2026 20:19:59 +0000 (20:19 +0000)
committerWilly Tarreau <w@1wt.eu>
Wed, 30 Sep 2026 14:26:01 +0000 (16:26 +0200)
commitba5d9512bf4a01ea6609618c5faefe7656a9bb4b
treea95b4d09de9205d633fbab049a60650306996603
parent763ed049a6dc966b86e85d1041fe999dee200d22
REGTESTS: sample_fetches: add a test for the HTTP request fetches

The request side header, URI and body fetches were largely uncovered.
This test checks req.hdr_val, req.hdr_ip, req.hdr_cnt with an occurrence
index, req.hdr_names with and without a custom delimiter, req.fhdr and
req.fhdr_cnt against req.hdr on a comma-delimited list, req.hdrs,
req.hdrs_bin, base, baseq, base32, base32+src, url32, url32+src, url_ip,
url_port, query, urlp_val, req.body_len, req.body_size, req.body_param
with and without the case-insensitive flag, req.timer.hdr,
req.timer.idle, req.ver, req.proto_http, the deprecated req_ver and
req_proto_http aliases, and the capture.req.method, capture.req.ver,
capture.req.uri and capture.req.hdr fetches.

The fetches are collected into variables from the http-request rule set
since most of them may not be used from the http-response one, and they
are reported in the response headers so that a single exchange suffices.

An absolute URI is used so that base, baseq, url_ip and url_port have
something to extract, which requires the Host header to match the
authority. A second request uses an address as the authority since
url_ip and url_port do not resolve host names.
reg-tests/sample_fetches/http_request.vtc [new file with mode: 0644]