MCPcopy Index your code
hub / github.com/cloudflare/cfssl / ServeHTTP

Method ServeHTTP

api/api.go:71–87  ·  view source on GitHub ↗

ServeHTTP encapsulates the call to underlying Handler to handle the request and return the response with proper HTTP status code

(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

69// ServeHTTP encapsulates the call to underlying Handler to handle the request
70// and return the response with proper HTTP status code
71func (h HTTPHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
72 var err error
73 var match bool
74 // Throw 405 when requested with an unsupported verb.
75 for _, m := range h.Methods {
76 if m == r.Method {
77 match = true
78 }
79 }
80 if match {
81 err = h.Handle(w, r)
82 } else {
83 err = errors.NewMethodNotAllowed(r.Method)
84 }
85 status := HandleError(w, err)
86 log.Infof("%s - \"%s %s\" %d", r.RemoteAddr, r.Method, r.URL, status)
87}
88
89// readRequestBlob takes a JSON-blob-encoded response body in the form
90// map[string]string and returns it, the list of keywords presented,

Callers 1

serverMainFunction · 0.45

Calls 4

NewMethodNotAllowedFunction · 0.92
InfofFunction · 0.92
HandleErrorFunction · 0.85
HandleMethod · 0.65

Tested by

no test coverage detected