From f1c36680fc8b21d5f8c110d8d3b97c4efe324376 Mon Sep 17 00:00:00 2001 From: Francis Lavoie Date: Mon, 29 Mar 2021 12:55:29 -0400 Subject: headers: Fix Caddyfile parsing for `request_header` with matchers (#4085) --- .../integration/caddyfile_adapt/request_header.txt | 90 ++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 caddytest/integration/caddyfile_adapt/request_header.txt (limited to 'caddytest') diff --git a/caddytest/integration/caddyfile_adapt/request_header.txt b/caddytest/integration/caddyfile_adapt/request_header.txt new file mode 100644 index 0000000..bab3fca --- /dev/null +++ b/caddytest/integration/caddyfile_adapt/request_header.txt @@ -0,0 +1,90 @@ +:80 + +@matcher path /something* +request_header @matcher Denis "Ritchie" + +request_header +Edsger "Dijkstra" +request_header -Wolfram + +@images path /images/* +request_header @images Cache-Control "public, max-age=3600, stale-while-revalidate=86400" +---------- +{ + "apps": { + "http": { + "servers": { + "srv0": { + "listen": [ + ":80" + ], + "routes": [ + { + "match": [ + { + "path": [ + "/something*" + ] + } + ], + "handle": [ + { + "handler": "headers", + "request": { + "set": { + "Denis": [ + "Ritchie" + ] + } + } + } + ] + }, + { + "match": [ + { + "path": [ + "/images/*" + ] + } + ], + "handle": [ + { + "handler": "headers", + "request": { + "set": { + "Cache-Control": [ + "public, max-age=3600, stale-while-revalidate=86400" + ] + } + } + } + ] + }, + { + "handle": [ + { + "handler": "headers", + "request": { + "add": { + "Edsger": [ + "Dijkstra" + ] + } + } + }, + { + "handler": "headers", + "request": { + "delete": [ + "Wolfram" + ] + } + } + ] + } + ] + } + } + } + } +} -- cgit v1.2.3