From 7c6461aa43cd15278bfedcf4873bfd1516f429f8 Mon Sep 17 00:00:00 2001 From: Jacob Weinstock Date: Fri, 8 Sep 2023 09:11:18 -0600 Subject: [PATCH] Remove body.Close on passed in *http.Response: Let the caller handle the close. Signed-off-by: Jacob Weinstock --- providers/rpc/http.go | 1 - 1 file changed, 1 deletion(-) diff --git a/providers/rpc/http.go b/providers/rpc/http.go index b83cfcff..c74b8642 100644 --- a/providers/rpc/http.go +++ b/providers/rpc/http.go @@ -53,7 +53,6 @@ func (p *Provider) handleResponse(resp *http.Response, reqKeysAndValues []interf p.Logger.Info("rpc notification details", kvs...) } }() - defer resp.Body.Close() bodyBytes, err := io.ReadAll(resp.Body) if err != nil { return ResponsePayload{}, fmt.Errorf("failed to read response body: %v", err)