MCPcopy
hub / github.com/caddyserver/caddy / Match

Method Match

modules/caddyhttp/celmatcher.go:204–210  ·  view source on GitHub ↗

Match returns true if r matches m.

(r *http.Request)

Source from the content-addressed store, hash-verified

202
203// Match returns true if r matches m.
204func (m MatchExpression) Match(r *http.Request) bool {
205 match, err := m.MatchWithError(r)
206 if err != nil {
207 SetVar(r.Context(), MatcherErrorVarKey, err)
208 }
209 return match
210}
211
212// MatchWithError returns true if r matches m.
213func (m MatchExpression) MatchWithError(r *http.Request) (bool, error) {

Callers

nothing calls this directly

Calls 2

MatchWithErrorMethod · 0.95
SetVarFunction · 0.85

Tested by

no test coverage detected