Skip to content

Commit

Permalink
[minor] Allow to write frames with up to 2^48 - 1 bytes of data (#1973)
Browse files Browse the repository at this point in the history
  • Loading branch information
prettydiff authored Nov 16, 2021
1 parent 5991c35 commit 4916d03
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/sender.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ class Sender {
if (payloadLength === 126) {
target.writeUInt16BE(data.length, 2);
} else if (payloadLength === 127) {
target.writeUInt32BE(0, 2);
target.writeUInt32BE(data.length, 6);
target[2] = 0;
target[3] = 0;
target.writeUIntBE(data.length, 4, 6);
}

if (!options.mask) return [target, data];
Expand Down

0 comments on commit 4916d03

Please sign in to comment.