summaryrefslogtreecommitdiff
path: root/op_crates/websocket/01_websocket.js
diff options
context:
space:
mode:
authorPreta Crowz <preta@siro.dev>2021-02-12 14:50:08 +0900
committerGitHub <noreply@github.com>2021-02-12 14:50:08 +0900
commit7f8b44a60d416b0cb2d2b84ef2aac71b4b3e3b31 (patch)
treeab9e4fdaaa12f10dcf1b29391768a9c522103cd6 /op_crates/websocket/01_websocket.js
parentd6c05b09dd7cbaba0fcae65929a2c2dd55e9d994 (diff)
fix(cli): fix WebSocket close (#8776)
Co-authored-by: Bartek IwaƄczuk <biwanczuk@gmail.com>
Diffstat (limited to 'op_crates/websocket/01_websocket.js')
-rw-r--r--op_crates/websocket/01_websocket.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/op_crates/websocket/01_websocket.js b/op_crates/websocket/01_websocket.js
index e12f08fe6..d9b1455bd 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",