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 }