MCPcopy Create free account
hub / github.com/imroc/req / WrapResponseBodyIfNeeded

Function WrapResponseBodyIfNeeded

internal/dump/dump.go:217–224  ·  view source on GitHub ↗
(res *http.Response, req *http.Request, dump *Dumper)

Source from the content-addressed store, hash-verified

215}
216
217func WrapResponseBodyIfNeeded(res *http.Response, req *http.Request, dump *Dumper) {
218 dumps := GetDumpers(req.Context(), dump)
219 for _, d := range dumps {
220 if d.ResponseBody() {
221 res.Body = d.WrapResponseBodyReadCloser(res.Body)
222 }
223 }
224}

Callers 2

handleResponseBodyMethod · 0.92

Calls 4

GetDumpersFunction · 0.85
ContextMethod · 0.65
ResponseBodyMethod · 0.65

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…