diff options
author | Francis Lavoie <[email protected]> | 2024-03-21 13:21:53 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2024-03-21 11:21:53 -0600 |
commit | d13258423dda01fa48943b203ba8074428c776e4 (patch) | |
tree | 38210d0502e3a05fcd230c12241a361eff3bc4e4 | |
parent | 32f7dd44aea270fa6c50bbf80acf5b831fc6ffcd (diff) | |
download | caddy-d13258423dda01fa48943b203ba8074428c776e4.tar.gz caddy-d13258423dda01fa48943b203ba8074428c776e4.zip |
vars: Make nil values act as empty string instead of `"<nil>"` (#6174)
-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) } |