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

Method AnyMatch

modules/caddyhttp/routes.go:412–424  ·  view source on GitHub ↗

AnyMatch returns true if req matches any of the matcher sets in ms or if there are no matchers, in which case the request always matches. Deprecated: Use AnyMatchWithError instead.

(req *http.Request)

Source from the content-addressed store, hash-verified

410//
411// Deprecated: Use AnyMatchWithError instead.
412func (ms MatcherSets) AnyMatch(req *http.Request) bool {
413 for _, m := range ms {
414 match, err := m.MatchWithError(req)
415 if err != nil {
416 SetVar(req.Context(), MatcherErrorVarKey, err)
417 return false
418 }
419 if match {
420 return match
421 }
422 }
423 return len(ms) == 0
424}
425
426// AnyMatchWithError returns true if req matches any of the
427// matcher sets in ms or if there are no matchers, in which

Callers

nothing calls this directly

Calls 2

SetVarFunction · 0.85
MatchWithErrorMethod · 0.65

Tested by

no test coverage detected