MCPcopy Create free account
hub / github.com/cloudflare/cfssl / readRequestBlob

Function readRequestBlob

api/api.go:92–106  ·  view source on GitHub ↗

readRequestBlob takes a JSON-blob-encoded response body in the form map[string]string and returns it, the list of keywords presented, and any error that occurred.

(r *http.Request)

Source from the content-addressed store, hash-verified

90// map[string]string and returns it, the list of keywords presented,
91// and any error that occurred.
92func readRequestBlob(r *http.Request) (map[string]string, error) {
93 var blob map[string]string
94
95 body, err := io.ReadAll(r.Body)
96 if err != nil {
97 return nil, err
98 }
99 r.Body.Close()
100
101 err = json.Unmarshal(body, &blob)
102 if err != nil {
103 return nil, err
104 }
105 return blob, nil
106}
107
108// ProcessRequestOneOf reads a JSON blob for the request and makes
109// sure it contains one of a set of keywords. For example, a request

Callers 2

ProcessRequestOneOfFunction · 0.85

Calls 1

CloseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…