mirror of
https://github.com/minio/minio.git
synced 2025-11-09 21:49:46 -05:00
fix: close and drain the response body always (#8847)
This commit is contained in:
@@ -20,6 +20,8 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net"
|
||||
"net/http"
|
||||
"net/url"
|
||||
@@ -100,6 +102,7 @@ func (u URL) DialHTTP() error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
io.Copy(ioutil.Discard, resp.Body)
|
||||
resp.Body.Close()
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user