aboutsummaryrefslogtreecommitdiffhomepage
path: root/modules/caddyhttp/vars.go
diff options
context:
space:
mode:
authorFrancis Lavoie <[email protected]>2024-03-17 01:54:33 -0400
committerFrancis Lavoie <[email protected]>2024-03-17 01:54:33 -0400
commit5c006b110fd323a61386dc1403192779cab8081b (patch)
treec00d2c08fbe233b16f774518feb6610d7b30c672 /modules/caddyhttp/vars.go
parent52822a41cb94fcc9669cd7ba8ac1a0513e4d55f9 (diff)
downloadcaddy-5c006b110fd323a61386dc1403192779cab8081b.tar.gz
caddy-5c006b110fd323a61386dc1403192779cab8081b.zip
vars: Make nil values act as empty string instead of `"<nil>"`vars-match-nil
Diffstat (limited to 'modules/caddyhttp/vars.go')
-rw-r--r--modules/caddyhttp/vars.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/caddyhttp/vars.go b/modules/caddyhttp/vars.go
index f5afe264a..9908ada9b 100644
--- a/modules/caddyhttp/vars.go
+++ b/modules/caddyhttp/vars.go
@@ -190,6 +190,8 @@ func (m VarsMatcher) Match(r *http.Request) bool {
varStr = vv.String()
case error:
varStr = vv.Error()
+ case nil:
+ varStr = ""
default:
varStr = fmt.Sprintf("%v", vv)
}
@@ -281,6 +283,8 @@ func (m MatchVarsRE) Match(r *http.Request) bool {
varStr = vv.String()
case error:
varStr = vv.Error()
+ case nil:
+ varStr = ""
default:
varStr = fmt.Sprintf("%v", vv)
}