From c26655878525846cb82117e04f7711dfea13a8bf Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sun, 15 Dec 2024 07:45:45 +0000 Subject: [PATCH] feat: remove io copy from validator client --- pkg/validator/client.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkg/validator/client.go b/pkg/validator/client.go index 7786618..114459d 100644 --- a/pkg/validator/client.go +++ b/pkg/validator/client.go @@ -4,7 +4,6 @@ import ( "context" "errors" "fmt" - "io" "net/http" "strings" "time" @@ -114,7 +113,6 @@ func (c *Client) Validate(parentCtx context.Context, headers http.Header, bearer // closeBody to avoid memory leak when reusing http connection. func closeBody(response *http.Response) { if response != nil { - _, _ = io.Copy(io.Discard, response.Body) _ = response.Body.Close() } }