don't read all and then throw away the buffer

This commit was moved from ipfs/go-ipfs-http-client@5c96c2954a
This commit is contained in:
Łukasz Magiera 2019-02-18 17:04:33 +01:00
parent 4a6d36d98b
commit 7229dbbf73

View File

@ -139,7 +139,7 @@ func (r *Request) Send(c *http.Client) (*Response, error) {
nresp.Output = nil
// drain body and close
ioutil.ReadAll(resp.Body)
io.Copy(ioutil.Discard, resp.Body)
resp.Body.Close()
}