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

Method notFound

modules/caddyhttp/fileserver/staticfiles.go:733–738  ·  view source on GitHub ↗

notFound returns a 404 error or, if pass-thru is enabled, it calls the next handler in the chain.

(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler)

Source from the content-addressed store, hash-verified

731// notFound returns a 404 error or, if pass-thru is enabled,
732// it calls the next handler in the chain.
733func (fsrv *FileServer) notFound(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error {
734 if fsrv.PassThru {
735 return next.ServeHTTP(w, r)
736 }
737 return caddyhttp.Error(http.StatusNotFound, nil)
738}
739
740// Indicates whether a file's modification time is useful for validator
741// generation purposes (i.e. inclusion in ETag and Last-Modified headers).

Callers 2

serveBrowseMethod · 0.95
ServeHTTPMethod · 0.95

Calls 2

ErrorFunction · 0.92
ServeHTTPMethod · 0.65

Tested by

no test coverage detected