summaryrefslogtreecommitdiff
path: root/ext/websocket/01_websocket.js
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2024-01-02 10:30:09 +0530
committerGitHub <noreply@github.com>2024-01-02 10:30:09 +0530
commit8e4feacd258b2fc019f2b9612133231fa8be14c0 (patch)
tree717333e65d6448d7e0c6bccf6ce89229d663cb76 /ext/websocket/01_websocket.js
parent642c4a44a56ed02c2bf795bf04d7aebbc847e150 (diff)
fix(ext/http): use arraybuffer binaryType for server websocket (#21741)
Ref https://github.com/denoland/deno/issues/15340#issuecomment-1872353134
Diffstat (limited to 'ext/websocket/01_websocket.js')
-rw-r--r--ext/websocket/01_websocket.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/websocket/01_websocket.js b/ext/websocket/01_websocket.js
index f28e3ef1b..57689d1ae 100644
--- a/ext/websocket/01_websocket.js
+++ b/ext/websocket/01_websocket.js
@@ -590,7 +590,11 @@ function createWebSocketBranded() {
socket[_extensions] = "";
socket[_protocol] = "";
socket[_url] = "";
- socket[_binaryType] = "blob";
+ // We use ArrayBuffer for server websockets for backwards compatibility
+ // and performance reasons.
+ //
+ // https://github.com/denoland/deno/issues/15340#issuecomment-1872353134
+ socket[_binaryType] = "arraybuffer";
socket[_idleTimeoutDuration] = 0;
socket[_idleTimeoutTimeout] = undefined;
return socket;