Add Envoy integration test to show Header manip can interpolate Envoy variables

This commit is contained in:
Paul Banks 2021-08-25 16:53:21 +01:00
parent a9bf4c9b82
commit 81eb706906
2 changed files with 4 additions and 0 deletions

View File

@ -25,6 +25,7 @@ config_entries {
}
set {
x-existing-2 = "replaced-req"
x-client-ip = "%DOWNSTREAM_REMOTE_ADDRESS_WITHOUT_PORT%"
}
remove = ["x-bad-req"]
}

View File

@ -63,6 +63,9 @@ load helpers
# Ingress should have replaced the second existing header
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
if echo "$output" | grep -E "^X-Bad-Req: true"; then
echo "X-Bad-Req request header should have been stripped but was still present"