aboutsummaryrefslogtreecommitdiffhomepage
path: root/replacer.go
diff options
context:
space:
mode:
authorMatthew Holt <[email protected]>2022-09-01 16:49:18 -0600
committerMatthew Holt <[email protected]>2022-09-01 16:49:18 -0600
commit7c35bfa57cb402e82b28118b69c265df3e8c94fd (patch)
tree441b133a48ed6e6750b2fb743c1cf617312a2c5f /replacer.go
parent1edc1a45e3aee1f7d86b68c3ddaf2fd16ba8ab73 (diff)
downloadcaddy-7c35bfa57cb402e82b28118b69c265df3e8c94fd.tar.gz
caddy-7c35bfa57cb402e82b28118b69c265df3e8c94fd.zip
caddyhttp: Accept placeholders in vars matcher key
Until now, the vars matcher has unintentionally lacked parity with the map directive: the destination placeholders of the map directive would be expressed as placeholders, i.e. {foo}. But the vars matcher would not use { }: vars foo value This looked weird, and was confusing, since it implied that the key could be dynamic, which doesn't seem helpful here. I think this is a proper bug fix, since we're not used to accessing placeholders literally without { } in the Caddyfile.
Diffstat (limited to 'replacer.go')
-rw-r--r--replacer.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/replacer.go b/replacer.go
index b8b226712..aa943cf73 100644
--- a/replacer.go
+++ b/replacer.go
@@ -238,6 +238,8 @@ func toString(val any) string {
return v
case fmt.Stringer:
return v.String()
+ case error:
+ return v.Error()
case byte:
return string(v)
case []byte: