mirror of
https://github.com/caddyserver/caddy.git
synced 2025-06-05 20:26:52 +08:00
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:
@ -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
|
||||
|
Reference in New Issue
Block a user