We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4959db6 commit 9a60ec0Copy full SHA for 9a60ec0
lib/web/websocket/sender.js
@@ -89,7 +89,7 @@ function createFrame (data, hint) {
89
function toBuffer (data, hint) {
90
switch (hint) {
91
case sendHints.string:
92
- return typeof data === 'string' ? Buffer.from(data) : data
+ return typeof data === 'string' ? Buffer.from(data) : new Uint8Array(data.buffer, data.byteOffset, data.byteLength)
93
case sendHints.arrayBuffer:
94
case sendHints.blob:
95
return new Uint8Array(data)
0 commit comments