Skip to content

Commit 9a60ec0

Browse files
authored
Update sender.js
1 parent 4959db6 commit 9a60ec0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/web/websocket/sender.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ function createFrame (data, hint) {
8989
function toBuffer (data, hint) {
9090
switch (hint) {
9191
case sendHints.string:
92-
return typeof data === 'string' ? Buffer.from(data) : data
92+
return typeof data === 'string' ? Buffer.from(data) : new Uint8Array(data.buffer, data.byteOffset, data.byteLength)
9393
case sendHints.arrayBuffer:
9494
case sendHints.blob:
9595
return new Uint8Array(data)

0 commit comments

Comments
 (0)