Browse Source

limit draining up to 512 bytes from response.Body

Updates #317
Will Norris 10 years ago
parent
commit
e85183c247
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      github/github.go

+ 2
- 2
github/github.go View File

@ -337,8 +337,8 @@ func (c *Client) Do(req *http.Request, v interface{}) (*Response, error) {
}
defer func() {
// Drain and close the body to let the Transport reuse the connection
io.Copy(ioutil.Discard, resp.Body)
// Drain up to 512 bytes and close the body to let the Transport reuse the connection
io.CopyN(ioutil.Discard, resp.Body, 512)
resp.Body.Close()
}()


Loading…
Cancel
Save