Update http.go

This commit is contained in:
Felix Lange 2024-03-12 10:04:49 +01:00 committed by GitHub
parent f93a7d22d3
commit a50dafde5e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -236,9 +236,7 @@ func (hc *httpConn) doRequest(ctx context.Context, msg interface{}) (io.ReadClos
if _, err := buf.ReadFrom(resp.Body); err == nil {
body = buf.Bytes()
}
resp.Body.Close()
return nil, HTTPError{
Status: resp.Status,
StatusCode: resp.StatusCode,