From ff606a539bd5d438382ece8b31ddf619283d0ce0 Mon Sep 17 00:00:00 2001 From: Kian Parvin Date: Wed, 4 Sep 2024 08:48:41 +0200 Subject: [PATCH] fix missing body close --- internal/rpc/dial.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/rpc/dial.go b/internal/rpc/dial.go index fea66fb0c..cee6f580b 100644 --- a/internal/rpc/dial.go +++ b/internal/rpc/dial.go @@ -45,11 +45,12 @@ func (d Dialer) DialWebsocket(ctx context.Context, url string, headers http.Head dialer := websocket.Dialer{ TLSClientConfig: d.TLSConfig, } - conn, _, err := dialer.DialContext(context.Background(), url, headers) + conn, resp, err := dialer.DialContext(context.Background(), url, headers) if err != nil { zapctx.Error(ctx, "BasicDial failed", zap.Error(err)) return nil, errors.E(op, err) } + defer resp.Body.Close() return conn, nil }