From 61822f129b9edbbc1ed2fd068d8e5ba919b5881d Mon Sep 17 00:00:00 2001 From: Will Norris Date: Wed, 28 Sep 2022 12:38:20 -0700 Subject: caddyhttp: replace placeholders in map defaults (#5081) This updates the map directive to replace placeholders in default values in the same way as matched values. --- modules/caddyhttp/map/map.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/caddyhttp/map/map.go') diff --git a/modules/caddyhttp/map/map.go b/modules/caddyhttp/map/map.go index d41806d..b972534 100644 --- a/modules/caddyhttp/map/map.go +++ b/modules/caddyhttp/map/map.go @@ -169,7 +169,7 @@ func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhtt // fall back to default if no match or if matched nil value if len(h.Defaults) > destIdx { - return h.Defaults[destIdx], true + return repl.ReplaceAll(h.Defaults[destIdx], ""), true } return nil, true -- cgit v1.2.3