From c92eb1bf2c27e4735bf92e65e7a3b7a29671e231 Mon Sep 17 00:00:00 2001 From: Mitar Date: Wed, 4 Oct 2023 03:02:18 -0700 Subject: [PATCH] Make sure response is fully consumed. --- gitlab.go | 1 + 1 file changed, 1 insertion(+) diff --git a/gitlab.go b/gitlab.go index 658628881..0f882bf2d 100644 --- a/gitlab.go +++ b/gitlab.go @@ -813,6 +813,7 @@ func (c *Client) Do(req *retryablehttp.Request, v interface{}) (*Response, error return c.Do(req, v) } defer resp.Body.Close() + defer io.Copy(io.Discard, resp.Body) // If not yet configured, try to configure the rate limiter // using the response headers we just received. Fail silently