From 69f1dc5075d08a29915a2374e33386a07fba8360 Mon Sep 17 00:00:00 2001 From: luyuhuang Date: Thu, 13 Aug 2020 22:41:45 +0800 Subject: [PATCH] close body --- ws.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ws.go b/ws.go index ec00b76..f77f8a7 100644 --- a/ws.go +++ b/ws.go @@ -788,12 +788,13 @@ func websocketClientConn(url string, conn net.Conn, tlsConfig *tls.Config, optio if err != nil { return nil, err } + resp.Body.Close() + if verifyErr != nil { c.Close() return nil, verifyErr } - resp.Body.Close() return &websocketConn{conn: c}, nil }