From 8e4feacd258b2fc019f2b9612133231fa8be14c0 Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Tue, 2 Jan 2024 10:30:09 +0530 Subject: fix(ext/http): use arraybuffer binaryType for server websocket (#21741) Ref https://github.com/denoland/deno/issues/15340#issuecomment-1872353134 --- ext/websocket/01_websocket.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ext/websocket/01_websocket.js') 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; -- cgit v1.2.3