diff --git a/internal/httpclient/client.go b/internal/httpclient/client.go index 74c931ea9..ba8760091 100644 --- a/internal/httpclient/client.go +++ b/internal/httpclient/client.go @@ -400,6 +400,7 @@ func (c *Client) do(r *Request) (rsp *http.Response, retry bool, err error) { // Check response body not too large. if rsp.ContentLength > c.bodyMax { + _ = rsp.Body.Close() return nil, false, ErrBodyTooLarge }