@marcel91200 / caddy Mirror · read-only / commits / d1325842
Fork 0

Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS

Mirrored from https://github.com/Slazee/caddy.git

Synced Nov 12, 15:45 UTC

vars: Make nil values act as empty string instead of `"<nil>"` (#6174)

Francis Lavoie committed Mar 21, 2024 at 13:21 UTC d13258423dda01fa48943b203ba8074428c776e4
1 file changed +4
modules/caddyhttp/vars.go
+4
@@ -190,6 +190,8 @@ func (m VarsMatcher) Match(r *http.Request) bool {
190 varStr = vv.String()
191 case error:
192 varStr = vv.Error()
193 + case nil:
194 + varStr = ""
195 default:
196 varStr = fmt.Sprintf("%v", vv)
197 }
@@ -281,6 +283,8 @@ func (m MatchVarsRE) Match(r *http.Request) bool {
283 varStr = vv.String()
284 case error:
285 varStr = vv.Error()
286 + case nil:
287 + varStr = ""
288 default:
289 varStr = fmt.Sprintf("%v", vv)
290 }