rpc: close ws handshake response body on error

This commit is contained in:
Sahil-4555 2026-01-15 08:52:45 +05:30
parent b80ffe98a5
commit 70a52dc4fb

View file

@ -249,6 +249,9 @@ func newClientTransportWS(endpoint string, cfg *clientConfig) (reconnectFunc, er
}
conn, resp, err := dialer.DialContext(ctx, dialURL, header)
if err != nil {
if resp != nil {
resp.Body.Close()
}
hErr := wsHandshakeError{err: err}
if resp != nil {
hErr.status = resp.Status