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

Method MatchWithError

modules/caddyhttp/matchers.go:996–999  ·  modules/caddyhttp/matchers.go::MatchHeader.MatchWithError

MatchWithError returns true if r matches m.

(r *http.Request)

Source from the content-addressed store, hash-verified

994
995// MatchWithError returns true if r matches m.
996func (m MatchHeader) MatchWithError(r *http.Request) (bool, error) {
997 repl := r.Context().Value(caddy.ReplacerCtxKey).(*caddy.Replacer)
998 return matchHeaders(r.Header, http.Header(m), r.Host, r.TransferEncoding, repl), nil
999}
1000
1001// CELLibrary produces options that expose this matcher for use in CEL
1002// expression matchers.

Callers 1

MatchMethod · 0.95

Calls 3

matchHeadersFunction · 0.85
ValueMethod · 0.45
HeaderMethod · 0.45

Tested by

no test coverage detected