Skip to content

Commit

Permalink
vars: Make nil values act as empty string instead of "<nil>" (#6174)
Browse files Browse the repository at this point in the history
  • Loading branch information
francislavoie committed Mar 21, 2024
1 parent 32f7dd4 commit d132584
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/caddyhttp/vars.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit d132584

Please sign in to comment.