1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-28 01:59:06 -05:00

fix(cli): fix WebSocket close (#8776)

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
This commit is contained in:
Preta Crowz 2021-02-12 14:50:08 +09:00 committed by GitHub
parent d6c05b09dd
commit 7f8b44a60d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -256,7 +256,7 @@
} }
close(code, reason) { close(code, reason) {
if (code && (code !== 1000 && !(3000 <= code > 5000))) { if (code && !(code === 1000 || (3000 <= code && code < 5000))) {
throw new DOMException( throw new DOMException(
"The close code must be either 1000 or in the range of 3000 to 4999.", "The close code must be either 1000 or in the range of 3000 to 4999.",
"NotSupportedError", "NotSupportedError",