MCPcopy
hub / github.com/safing/portmaster / ServeHTTP

Method ServeHTTP

base/api/endpoints.go:359–367  ·  view source on GitHub ↗

ServeHTTP handles the http request.

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

Source from the content-addressed store, hash-verified

357
358// ServeHTTP handles the http request.
359func (eh *endpointHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
360 apiEndpoint, apiRequest := getAPIContext(r)
361 if apiEndpoint == nil || apiRequest == nil {
362 http.NotFound(w, r)
363 return
364 }
365
366 apiEndpoint.ServeHTTP(w, r)
367}
368
369// ServeHTTP handles the http request.
370func (e *Endpoint) ServeHTTP(w http.ResponseWriter, r *http.Request) {

Callers

nothing calls this directly

Calls 2

getAPIContextFunction · 0.85
ServeHTTPMethod · 0.45

Tested by

no test coverage detected