Verified Commit cb2ba0cc authored by heiko.reese's avatar heiko.reese 💤
Browse files

Always drain and close http response body

parent 4f3330d5
Pipeline #169211 passed with stages
in 1 minute
......@@ -122,6 +122,12 @@ func (c *NETVSClient) ExecuteTA(t Transaction) (TAResult, error) {
if err != nil {
return response, err
}
defer func() {
// Drain and close the body to let the Transport reuse the connection
// see https://github.com/google/go-github/pull/317 for details
_, _ = io.Copy(ioutil.Discard, resp.Body)
_ = resp.Body.Close()
}()
// handle errors based on HTTP return code
switch resp.StatusCode {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment