From 7f8b44a60d416b0cb2d2b84ef2aac71b4b3e3b31 Mon Sep 17 00:00:00 2001 From: Preta Crowz Date: Fri, 12 Feb 2021 14:50:08 +0900 Subject: [PATCH] fix(cli): fix WebSocket close (#8776) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Bartek IwaƄczuk --- op_crates/websocket/01_websocket.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/op_crates/websocket/01_websocket.js b/op_crates/websocket/01_websocket.js index e12f08fe6c..d9b1455bde 100644 --- a/op_crates/websocket/01_websocket.js +++ b/op_crates/websocket/01_websocket.js @@ -256,7 +256,7 @@ } close(code, reason) { - if (code && (code !== 1000 && !(3000 <= code > 5000))) { + if (code && !(code === 1000 || (3000 <= code && code < 5000))) { throw new DOMException( "The close code must be either 1000 or in the range of 3000 to 4999.", "NotSupportedError",