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

Method Match

modules/caddyhttp/ip_matchers.go:253–259  ·  view source on GitHub ↗

Match returns true if r matches m.

(r *http.Request)

Source from the content-addressed store, hash-verified

251
252// Match returns true if r matches m.
253func (m MatchClientIP) Match(r *http.Request) bool {
254 match, err := m.MatchWithError(r)
255 if err != nil {
256 SetVar(r.Context(), MatcherErrorVarKey, err)
257 }
258 return match
259}
260
261// MatchWithError returns true if r matches m.
262func (m MatchClientIP) 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