summaryrefslogtreecommitdiff
path: root/caddytest
diff options
context:
space:
mode:
authorFrancis Lavoie <lavofr@gmail.com>2022-05-02 13:44:28 -0400
committerGitHub <noreply@github.com>2022-05-02 11:44:28 -0600
commit4a223f52038cb77bbf97ca3f3345550dea4e12d8 (patch)
treeda1eb2b18a257fc0bfea86cf45e1ca14fc4f28a6 /caddytest
parentaf7321511c960120d61cfd22e031f43071d5a9c2 (diff)
reverseproxy: Fix Caddyfile support for `replace_status` (#4754)
Diffstat (limited to 'caddytest')
-rw-r--r--caddytest/integration/caddyfile_adapt/reverse_proxy_handle_response.txt23
1 files changed, 21 insertions, 2 deletions
diff --git a/caddytest/integration/caddyfile_adapt/reverse_proxy_handle_response.txt b/caddytest/integration/caddyfile_adapt/reverse_proxy_handle_response.txt
index 1b6162d..f6a2609 100644
--- a/caddytest/integration/caddyfile_adapt/reverse_proxy_handle_response.txt
+++ b/caddytest/integration/caddyfile_adapt/reverse_proxy_handle_response.txt
@@ -1,8 +1,13 @@
:8884
reverse_proxy 127.0.0.1:65535 {
- @changeStatus status 500
- replace_status @changeStatus 400
+ @500 status 500
+ replace_status @500 400
+
+ @all status 2xx 3xx 4xx 5xx
+ replace_status @all {http.error.status_code}
+
+ replace_status {http.error.status_code}
@accel header X-Accel-Redirect *
handle_response @accel {
@@ -80,6 +85,17 @@ reverse_proxy 127.0.0.1:65535 {
},
{
"match": {
+ "status_code": [
+ 2,
+ 3,
+ 4,
+ 5
+ ]
+ },
+ "status_code": "{http.error.status_code}"
+ },
+ {
+ "match": {
"headers": {
"X-Accel-Redirect": [
"*"
@@ -229,6 +245,9 @@ reverse_proxy 127.0.0.1:65535 {
]
},
{
+ "status_code": "{http.error.status_code}"
+ },
+ {
"routes": [
{
"handle": [