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

Method AnyMatchWithError

modules/caddyhttp/routes.go:430–438  ·  view source on GitHub ↗

AnyMatchWithError 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. If any matcher returns an error, we cut short and return the error.

(req *http.Request)

Source from the content-addressed store, hash-verified

428// case the request always matches. If any matcher returns
429// an error, we cut short and return the error.
430func (ms MatcherSets) AnyMatchWithError(req *http.Request) (bool, error) {
431 for _, m := range ms {
432 match, err := m.MatchWithError(req)
433 if err != nil || match {
434 return match, err
435 }
436 }
437 return len(ms) == 0, nil
438}
439
440// FromInterface fills ms from an 'any' value obtained from LoadModule.
441func (ms *MatcherSets) FromInterface(matcherSets any) error {

Callers 2

wrapRouteFunction · 0.80
tryAgainMethod · 0.80

Calls 1

MatchWithErrorMethod · 0.65

Tested by

no test coverage detected