mirror of
https://github.com/minio/minio.git
synced 2024-12-24 22:25:54 -05:00
Close client connection after checking for release update (#3820)
This commit is contained in:
parent
77c1998a38
commit
09e9fd745c
@ -155,6 +155,10 @@ func downloadReleaseData(releaseChecksumURL string, timeout time.Duration) (data
|
||||
|
||||
client := &http.Client{
|
||||
Timeout: timeout,
|
||||
Transport: &http.Transport{
|
||||
// need to close connection after usage.
|
||||
DisableKeepAlives: true,
|
||||
},
|
||||
}
|
||||
|
||||
resp, err := client.Do(req)
|
||||
@ -164,6 +168,7 @@ func downloadReleaseData(releaseChecksumURL string, timeout time.Duration) (data
|
||||
if resp == nil {
|
||||
return data, fmt.Errorf("No response from server to download URL %s", releaseChecksumURL)
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
return data, fmt.Errorf("Error downloading URL %s. Response: %v", releaseChecksumURL, resp.Status)
|
||||
|
Loading…
Reference in New Issue
Block a user