mirror of https://github.com/status-im/consul.git
Add Envoy integration test to show Header manip can interpolate Envoy variables
This commit is contained in:
parent
a9bf4c9b82
commit
81eb706906
|
@ -25,6 +25,7 @@ config_entries {
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
x-existing-2 = "replaced-req"
|
x-existing-2 = "replaced-req"
|
||||||
|
x-client-ip = "%DOWNSTREAM_REMOTE_ADDRESS_WITHOUT_PORT%"
|
||||||
}
|
}
|
||||||
remove = ["x-bad-req"]
|
remove = ["x-bad-req"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,6 +63,9 @@ load helpers
|
||||||
# Ingress should have replaced the second existing header
|
# Ingress should have replaced the second existing header
|
||||||
echo "$output" | grep -E "^X-Existing-2: replaced-req"
|
echo "$output" | grep -E "^X-Existing-2: replaced-req"
|
||||||
|
|
||||||
|
# Ingress should have set the client ip from dynamic Envoy variable
|
||||||
|
echo "$output" | grep -E "^X-Client-Ip: 127.0.0.1"
|
||||||
|
|
||||||
# Ingress should have removed the bad request header
|
# Ingress should have removed the bad request header
|
||||||
if echo "$output" | grep -E "^X-Bad-Req: true"; then
|
if echo "$output" | grep -E "^X-Bad-Req: true"; then
|
||||||
echo "X-Bad-Req request header should have been stripped but was still present"
|
echo "X-Bad-Req request header should have been stripped but was still present"
|
||||||
|
|
Loading…
Reference in New Issue