]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REGTEST: http-rules/h00003: Use a different client for requests expecting a 301
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 1 Apr 2019 09:21:57 +0000 (11:21 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 1 Apr 2019 13:43:40 +0000 (15:43 +0200)
Because HAProxy may decide to close 301 responses, as others internal responses,
it is safer to use a different client for these requests. This is not the
purpose of this test to verify the keep-alive in such cases.

reg-tests/http-rules/h00003.vtc

index 55bb2687d3abe02ee74eca5283e50b039d6d162e..64cedc292ed5da0d090f72ee7a46aa3341a82ffb 100644 (file)
@@ -84,34 +84,41 @@ client c1 -connect ${h1_fe1_sock} {
     rxresp
     expect resp.status == 301
     expect resp.http.location ~ "https://www.example.org"
+    # Closes connection
+} -run
 
+client c2 -connect ${h1_fe1_sock} {
     txreq -hdr "Host: subdomain.example.org"
     rxresp
     expect resp.status == 301
     expect resp.http.location ~ "https://www.subdomain.example.org"
+    # Closes connection
+} -run
 
+client c3 -connect ${h1_fe1_sock} {
     # redirect on Testvar header
     txreq -hdr "Testvar: subdomain.example.org"
     rxresp
     expect resp.status == 301
     expect resp.http.location ~ "https://www.subdomain.example.org"
+    # Closes connection
 } -run
 
-client c2 -connect ${h1_fe1_sock} {
+client c4 -connect ${h1_fe1_sock} {
     txreq -hdr "Host: www.subdomain.example.org"
     rxresp
     expect resp.status == 403
     # Closes connection
 } -run
 
-client c3 -connect ${h1_fe1_sock} {
+client c5 -connect ${h1_fe1_sock} {
     txreq -hdr "Testvar: www.subdomain.example.org"
     rxresp
     expect resp.status == 403
     # Closes connection
 } -run
 
-client c4 -connect ${h1_fe1_sock} {
+client c6 -connect ${h1_fe1_sock} {
     txreq -hdr "Host: :8443example.org"
     rxresp
     expect resp.status == 403
@@ -119,7 +126,7 @@ client c4 -connect ${h1_fe1_sock} {
 } -run
 
 # Check map backend selection
-client c5 -connect ${h1_fe1_sock} {
+client c7 -connect ${h1_fe1_sock} {
     txreq -hdr "Host: test1.example.com"
     rxresp
     expect resp.status == 200