From 60307b9723c7f6fea4ad471f28159eb1d63161b5 Mon Sep 17 00:00:00 2001 From: guangwu Date: Thu, 18 Apr 2024 16:25:00 +0800 Subject: [PATCH] fix: close res body --- 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 {