Skip to content

Commit

Permalink
Update sender.js
Browse files Browse the repository at this point in the history
  • Loading branch information
tsctx committed Jul 6, 2024
1 parent 4959db6 commit 9a60ec0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/web/websocket/sender.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function createFrame (data, hint) {
function toBuffer (data, hint) {
switch (hint) {
case sendHints.string:
return typeof data === 'string' ? Buffer.from(data) : data
return typeof data === 'string' ? Buffer.from(data) : new Uint8Array(data.buffer, data.byteOffset, data.byteLength)
case sendHints.arrayBuffer:
case sendHints.blob:
return new Uint8Array(data)
Expand Down

0 comments on commit 9a60ec0

Please sign in to comment.