diff options
Diffstat (limited to 'caddytest')
-rw-r--r-- | caddytest/integration/caddyfile_adapt/reverse_proxy_handle_response.txt | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/caddytest/integration/caddyfile_adapt/reverse_proxy_handle_response.txt b/caddytest/integration/caddyfile_adapt/reverse_proxy_handle_response.txt index 88ecbc2..1b6162d 100644 --- a/caddytest/integration/caddyfile_adapt/reverse_proxy_handle_response.txt +++ b/caddytest/integration/caddyfile_adapt/reverse_proxy_handle_response.txt @@ -41,6 +41,20 @@ reverse_proxy 127.0.0.1:65535 { handle_response @multi { respond "Headers Foo, Bar AND statuses 401, 403 and 404!" } + + @200 status 200 + handle_response @200 { + copy_response_headers { + include Foo Bar + } + respond "Copied headers from the response" + } + + @201 status 201 + handle_response @201 { + header Foo "Copying the response" + copy_response 404 + } } ---------- { @@ -164,6 +178,57 @@ reverse_proxy 127.0.0.1:65535 { ] }, { + "match": { + "status_code": [ + 200 + ] + }, + "routes": [ + { + "handle": [ + { + "handler": "copy_response_headers", + "include": [ + "Foo", + "Bar" + ] + }, + { + "body": "Copied headers from the response", + "handler": "static_response" + } + ] + } + ] + }, + { + "match": { + "status_code": [ + 201 + ] + }, + "routes": [ + { + "handle": [ + { + "handler": "headers", + "response": { + "set": { + "Foo": [ + "Copying the response" + ] + } + } + }, + { + "handler": "copy_response", + "status_code": 404 + } + ] + } + ] + }, + { "routes": [ { "handle": [ |