From 7c35bfa57cb402e82b28118b69c265df3e8c94fd Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Thu, 1 Sep 2022 16:49:18 -0600 Subject: 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. --- replacer.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'replacer.go') diff --git a/replacer.go b/replacer.go index b8b2267..aa943cf 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: -- cgit v1.2.3