mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-11-30 07:11:04 +01:00
REGTEST: http-rules/h00003: Use a different client for requests expecting a 301
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.
This commit is contained in:
parent
f7b941c895
commit
7057898f0f
@ -84,34 +84,41 @@ client c1 -connect ${h1_fe1_sock} {
|
|||||||
rxresp
|
rxresp
|
||||||
expect resp.status == 301
|
expect resp.status == 301
|
||||||
expect resp.http.location ~ "https://www.example.org"
|
expect resp.http.location ~ "https://www.example.org"
|
||||||
|
# Closes connection
|
||||||
|
} -run
|
||||||
|
|
||||||
|
client c2 -connect ${h1_fe1_sock} {
|
||||||
txreq -hdr "Host: subdomain.example.org"
|
txreq -hdr "Host: subdomain.example.org"
|
||||||
rxresp
|
rxresp
|
||||||
expect resp.status == 301
|
expect resp.status == 301
|
||||||
expect resp.http.location ~ "https://www.subdomain.example.org"
|
expect resp.http.location ~ "https://www.subdomain.example.org"
|
||||||
|
# Closes connection
|
||||||
|
} -run
|
||||||
|
|
||||||
|
client c3 -connect ${h1_fe1_sock} {
|
||||||
# redirect on Testvar header
|
# redirect on Testvar header
|
||||||
txreq -hdr "Testvar: subdomain.example.org"
|
txreq -hdr "Testvar: subdomain.example.org"
|
||||||
rxresp
|
rxresp
|
||||||
expect resp.status == 301
|
expect resp.status == 301
|
||||||
expect resp.http.location ~ "https://www.subdomain.example.org"
|
expect resp.http.location ~ "https://www.subdomain.example.org"
|
||||||
|
# Closes connection
|
||||||
} -run
|
} -run
|
||||||
|
|
||||||
client c2 -connect ${h1_fe1_sock} {
|
client c4 -connect ${h1_fe1_sock} {
|
||||||
txreq -hdr "Host: www.subdomain.example.org"
|
txreq -hdr "Host: www.subdomain.example.org"
|
||||||
rxresp
|
rxresp
|
||||||
expect resp.status == 403
|
expect resp.status == 403
|
||||||
# Closes connection
|
# Closes connection
|
||||||
} -run
|
} -run
|
||||||
|
|
||||||
client c3 -connect ${h1_fe1_sock} {
|
client c5 -connect ${h1_fe1_sock} {
|
||||||
txreq -hdr "Testvar: www.subdomain.example.org"
|
txreq -hdr "Testvar: www.subdomain.example.org"
|
||||||
rxresp
|
rxresp
|
||||||
expect resp.status == 403
|
expect resp.status == 403
|
||||||
# Closes connection
|
# Closes connection
|
||||||
} -run
|
} -run
|
||||||
|
|
||||||
client c4 -connect ${h1_fe1_sock} {
|
client c6 -connect ${h1_fe1_sock} {
|
||||||
txreq -hdr "Host: :8443example.org"
|
txreq -hdr "Host: :8443example.org"
|
||||||
rxresp
|
rxresp
|
||||||
expect resp.status == 403
|
expect resp.status == 403
|
||||||
@ -119,7 +126,7 @@ client c4 -connect ${h1_fe1_sock} {
|
|||||||
} -run
|
} -run
|
||||||
|
|
||||||
# Check map backend selection
|
# Check map backend selection
|
||||||
client c5 -connect ${h1_fe1_sock} {
|
client c7 -connect ${h1_fe1_sock} {
|
||||||
txreq -hdr "Host: test1.example.com"
|
txreq -hdr "Host: test1.example.com"
|
||||||
rxresp
|
rxresp
|
||||||
expect resp.status == 200
|
expect resp.status == 200
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user