MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / readAndRestoreRequestBody

Function readAndRestoreRequestBody

internal/pluginhost/adapters.go:2140–2151  ·  view source on GitHub ↗
(r *http.Request)

Source from the content-addressed store, hash-verified

2138}
2139
2140func readAndRestoreRequestBody(r *http.Request) ([]byte, error) {
2141 if r == nil || r.Body == nil {
2142 return nil, nil
2143 }
2144 body, errReadAll := io.ReadAll(r.Body)
2145 if errReadAll != nil {
2146 r.Body = io.NopCloser(bytes.NewReader(body))
2147 return nil, errReadAll
2148 }
2149 r.Body = io.NopCloser(bytes.NewReader(body))
2150 return body, nil
2151}
2152
2153func authID(auth *coreauth.Auth) string {
2154 if auth == nil {

Callers 2

AuthenticateMethod · 0.85
HttpRequestMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected