diff options
author | Francis Lavoie <[email protected]> | 2024-03-17 01:54:33 -0400 |
---|---|---|
committer | Francis Lavoie <[email protected]> | 2024-03-17 01:54:33 -0400 |
commit | 5c006b110fd323a61386dc1403192779cab8081b (patch) | |
tree | c00d2c08fbe233b16f774518feb6610d7b30c672 | |
parent | 52822a41cb94fcc9669cd7ba8ac1a0513e4d55f9 (diff) | |
download | caddy-5c006b110fd323a61386dc1403192779cab8081b.tar.gz caddy-5c006b110fd323a61386dc1403192779cab8081b.zip |
vars: Make nil values act as empty string instead of `"<nil>"`vars-match-nil
-rw-r--r-- | modules/caddyhttp/vars.go | 4 |
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) } |