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

Method ServeHTTP

modules/caddyhttp/subroute.go:72–81  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request, next Handler)

Source from the content-addressed store, hash-verified

70}
71
72func (sr *Subroute) ServeHTTP(w http.ResponseWriter, r *http.Request, next Handler) error {
73 subroute := sr.Routes.Compile(next)
74 err := subroute.ServeHTTP(w, r)
75 if err != nil && sr.Errors != nil {
76 r = sr.Errors.WithError(r, err)
77 errRoute := sr.Errors.Routes.Compile(next)
78 return errRoute.ServeHTTP(w, r)
79 }
80 return err
81}
82
83// Interface guards
84var (

Callers

nothing calls this directly

Calls 3

WithErrorMethod · 0.80
ServeHTTPMethod · 0.65
CompileMethod · 0.45

Tested by

no test coverage detected