Merge pull request #1406 from nspcc-dev/rpc-fix-websocket-tests

rpc/server: fix "websocket: bad handshake" during testing
This commit is contained in:
Roman Khimov 2020-09-16 14:27:12 +03:00 committed by GitHub
commit e414ad3d47
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -974,6 +974,7 @@ func doRPCCallOverWS(rpcCall string, url string, t *testing.T) []byte {
c.SetReadDeadline(time.Now().Add(time.Second))
_, body, err := c.ReadMessage()
require.NoError(t, err)
require.NoError(t, c.Close())
return bytes.TrimSpace(body)
}