]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REG-TESTS: cache: Remove T-E header for 304-Not-Modified responses
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 16 Nov 2022 16:19:42 +0000 (17:19 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 16 Nov 2022 16:19:43 +0000 (17:19 +0100)
VTEST does not properly handle 304-Not-Modified responses. If a
Transfer-Encoding header (and probably a Content-Lenght header too), it
waits for a body. Waiting for a fix, the Transfer-Encoding encoding of
cached responses in 2 VTEST scripts are removed.

Note it is now an issue because of a fix in the H1 multiplexer :

  * 226082d13a "BUG/MINOR: mux-h1: Do not send a last null chunk on body-less answers"

This patch must be backported with the above commit.

reg-tests/cache/if-modified-since.vtc
reg-tests/cache/if-none-match.vtc

index 4d6ea6f6a161c31c8ea479c31cdcb6cf6fe7d9d8..a49e4732a4a51aef73c878a3743015dfd3aa636c 100644 (file)
@@ -61,6 +61,10 @@ haproxy h1 -conf {
                server www ${s1_addr}:${s1_port}
                http-response cache-store my_cache
 
+               # Remove Transfer-Encoding header because of a vtest issue with
+               # 304-Not-Modified responses
+               http-after-response del-header transfer-encoding if { status eq 304 }
+
        cache my_cache
                total-max-size 3
                max-age 20
@@ -148,4 +152,3 @@ client c1 -connect ${h1_fe_sock} {
        expect resp.bodylen == 0
 
 } -run
-
index b5ad033bb9590434de97e45f2abbad238c8049cb..ff90ad4223923e1ad08989ea4a04d3e6aadacfa3 100644 (file)
@@ -46,6 +46,10 @@ haproxy h1 -conf {
                server www ${s1_addr}:${s1_port}
                http-response cache-store my_cache
 
+               # Remove Transfer-Encoding header because of a vtest issue with
+               # 304-Not-Modified responses
+               http-after-response del-header transfer-encoding if { status eq 304 }
+
        cache my_cache
                total-max-size 3
                max-age 20