Remove body close

This commit is contained in:
Ben Sarmiento
2024-01-22 23:23:55 +01:00
parent 6cd9db58d2
commit e117b5e75a

View File

@@ -181,9 +181,6 @@ func (r *HTTPClient) Do(req *http.Request) (*http.Response, error) {
attempt := 0 attempt := 0
for { for {
resp, err = r.client.Do(req) resp, err = r.client.Do(req)
if err != nil {
defer resp.Body.Close()
}
if resp != nil && (resp.StatusCode < http.StatusOK || resp.StatusCode > http.StatusPartialContent) { if resp != nil && (resp.StatusCode < http.StatusOK || resp.StatusCode > http.StatusPartialContent) {
body, _ := io.ReadAll(resp.Body) body, _ := io.ReadAll(resp.Body)
if body != nil { if body != nil {