mirror of
https://github.com/caddyserver/caddy.git
synced 2024-11-26 10:13:39 +08:00
vars: Make nil values act as empty string instead of "<nil>"
(#6174)
This commit is contained in:
parent
32f7dd44ae
commit
d13258423d
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user