From a26f70a12b1289231d705bc002fe1df3180cb6c5 Mon Sep 17 00:00:00 2001 From: Francis Lavoie Date: Mon, 30 Nov 2020 12:20:30 -0500 Subject: headers: Fix Caddyfile parsing with request matcher (#3892) --- caddytest/integration/caddyfile_adapt/header.txt | 25 ++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'caddytest/integration/caddyfile_adapt') diff --git a/caddytest/integration/caddyfile_adapt/header.txt b/caddytest/integration/caddyfile_adapt/header.txt index b8e102f..19a5b41 100644 --- a/caddytest/integration/caddyfile_adapt/header.txt +++ b/caddytest/integration/caddyfile_adapt/header.txt @@ -9,6 +9,10 @@ ?Tim "Berners-Lee" defer } + @images path /images/* + header @images { + Cache-Control "public, max-age=3600, stale-while-revalidate=86400" + } } ---------- { @@ -20,6 +24,27 @@ ":80" ], "routes": [ + { + "match": [ + { + "path": [ + "/images/*" + ] + } + ], + "handle": [ + { + "handler": "headers", + "response": { + "set": { + "Cache-Control": [ + "public, max-age=3600, stale-while-revalidate=86400" + ] + } + } + } + ] + }, { "handle": [ { -- cgit v1.2.3