From 63ee6fc6a42a89d51c9caac632cefd65218825ab Mon Sep 17 00:00:00 2001 From: guangwu Date: Wed, 1 May 2024 07:21:33 +0800 Subject: [PATCH] Fix closing response body (#271) --- pkg/http/client.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/http/client.go b/pkg/http/client.go index 93fbabc3..3ebead93 100644 --- a/pkg/http/client.go +++ b/pkg/http/client.go @@ -81,6 +81,7 @@ func (c *client[R]) Send(req Request) (Result[R], error) { if err != nil { return Result[R]{}, fmt.Errorf("request failed: %w", err) } + defer res.Body.Close() err = c.cookieJar.Save() if err != nil {