don't read all and then throw away the buffer
This commit was moved from ipfs/go-ipfs-http-client@5c96c2954a5d45dd907dca9942d2773d76b8a71b
Łukasz Magiera committed
Feb 18, 2019 at 17:04 UTC
7229dbbf73fd925da390fc5db5a25caf398b1fe8
1 file changed
+1
-1
client/httpapi/response.go
+1
-1
@@ -139,7 +139,7 @@ func (r *Request) Send(c *http.Client) (*Response, error) {
139
nresp.Output = nil
140
141
// drain body and close
142
- ioutil.ReadAll(resp.Body)
142
+ io.Copy(ioutil.Discard, resp.Body)
143
resp.Body.Close()
144
}
145