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

This commit is contained in:
Francis Lavoie 2024-03-21 13:21:53 -04:00 committed by GitHub
parent 32f7dd44ae
commit d13258423d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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)
}