Skip to content

Commit

Permalink
fix: proxy binarytype as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Percslol committed Oct 14, 2024
1 parent d2aa02a commit 59bd5eb
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/client/requests/websocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,18 @@ class WebSocketApi extends EventEmitter {
true
);

this.ctx.overrideDescriptor(this.wsProto, 'binaryType', {
get: (target, that) => {
const ws = this.socketmap.get(that);

return ws.binaryType;
},
set: (target, that, value) => {
const ws = this.socketmap.get(that);
if (value[0] === "blob" || value[0] === "arraybuffer") ws.binaryType = value[0];
},
});

this.ctx.overrideDescriptor(this.wsProto, 'bufferedAmount', {
get: (target, that) => {
return 0;
Expand Down

0 comments on commit 59bd5eb

Please sign in to comment.