MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / NotFoundHandler

Method NotFoundHandler

server/router.go:152–158  ·  view source on GitHub ↗

NotFoundHandler is default 404 handler

(reqID string, rw ResponseWriter, req *http.Request)

Source from the content-addressed store, hash-verified

150
151// NotFoundHandler is default 404 handler
152func (r *Router) NotFoundHandler(reqID string, rw ResponseWriter, req *http.Request) *Error {
153 rw.Header().Set(httpheaders.ContentType, "text/plain")
154 rw.WriteHeader(http.StatusNotFound)
155 rw.Write([]byte{' '}) // Write a single byte to make AWS Lambda happy
156
157 return nil
158}
159
160// OkHandler is a default 200 OK handler
161func (r *Router) OkHandler(reqID string, rw ResponseWriter, req *http.Request) *Error {

Callers 1

ServeHTTPMethod · 0.95

Calls 3

WriteHeaderMethod · 0.80
SetMethod · 0.45
WriteMethod · 0.45

Tested by

no test coverage detected