]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REGTESTS: silence warning "L6 sample fetches ignored" in cond_set_var
authorWilly Tarreau <w@1wt.eu>
Tue, 19 Nov 2024 07:27:47 +0000 (08:27 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 19 Nov 2024 07:33:15 +0000 (08:33 +0100)
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.

reg-tests/sample_fetches/cond_set_var.vtc

index 67786ae0499bd101266b4f67b84d599d015a3661..82961e1007135ef60f705138cd023f0a251690d4 100644 (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