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.
This commit is contained in:
Will Norris
2022-09-28 12:38:20 -07:00
committed by GitHub
parent e3e8aabbcf
commit 61822f129b
2 changed files with 23 additions and 1 deletions

View File

@ -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