REGTESTS: silence warning "L6 sample fetches ignored" in cond_set_var

This reg-test uses req.len in an HTTP backend. It does work but emits a
warning suggesting that this is ignored, so most likely its days are
counted now. Let's just use req.hdrs,length instead.
This commit is contained in:
Willy Tarreau 2024-11-19 08:27:47 +01:00
parent b9537fe66d
commit 52b72ec3ba

View File

@ -269,7 +269,7 @@ haproxy h1 -conf {
backend converter_be
server s1 ${s1_addr}:${s1_port}
http-request deny if { req.len,set-var(proc.req_len,ifexists) -m int 0 }
http-request deny if { req.hdrs,length,set-var(proc.req_len,ifexists) -m int 0 }
http-request deny if { req.hdr("X-Cust"),set-var(sess.x_cust,ifnotempty,ifnotset),length -m int 0 }
http-response set-header x-var "proc.req_len=%[var(proc.req_len)] sess.x_cust=%[var(sess.x_cust)]"
@ -358,5 +358,5 @@ client c10 -connect ${h1_mainfe_sock} {
txreq -url "/converter" -hdr "X-Cust: foobar"
rxresp
expect resp.status == 200
expect resp.http.x-var == "proc.req_len=67 sess.x_cust=foobar"
expect resp.http.x-var == "proc.req_len=35 sess.x_cust=foobar"
} -run