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

Function GetAPIRequest

base/api/request.go:43–49  ·  view source on GitHub ↗

GetAPIRequest returns the API Request of the given http request.

(r *http.Request)

Source from the content-addressed store, hash-verified

41
42// GetAPIRequest returns the API Request of the given http request.
43func GetAPIRequest(r *http.Request) *Request {
44 ar, ok := r.Context().Value(RequestContextKey).(*Request)
45 if ok {
46 return ar
47 }
48 return nil
49}
50
51// TextResponse writes a text response.
52func TextResponse(w http.ResponseWriter, r *http.Request, text string) {

Callers 8

getUpdateResourceFunction · 0.92
ServeHTTPMethod · 0.92
handleMapGraphRequestFunction · 0.92
ServeHTTPMethod · 0.92
authBearerFunction · 0.85
authBasicFunction · 0.85
getAPIContextFunction · 0.85
ServeHTTPMethod · 0.85

Calls 2

ContextMethod · 0.65
ValueMethod · 0.45

Tested by 1

ServeHTTPMethod · 0.68