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

Method OkHandler

server/router.go:161–167  ·  view source on GitHub ↗

OkHandler is a default 200 OK handler

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

Source from the content-addressed store, hash-verified

159
160// OkHandler is a default 200 OK handler
161func (r *Router) OkHandler(reqID string, rw ResponseWriter, req *http.Request) *Error {
162 rw.Header().Set(httpheaders.ContentType, "text/plain")
163 rw.WriteHeader(http.StatusOK)
164 rw.Write([]byte{' '}) // Write a single byte to make AWS Lambda happy
165
166 return nil
167}
168
169// add adds an abitary route to the router
170func (r *Router) add(method, path string, handler RouteHandler, middlewares ...Middleware) *route {

Callers

nothing calls this directly

Calls 3

WriteHeaderMethod · 0.80
SetMethod · 0.45
WriteMethod · 0.45

Tested by

no test coverage detected