Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use dataLength #2004

Merged
merged 3 commits into from Jan 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/sender.js
Expand Up @@ -103,10 +103,10 @@ class Sender {

let payloadLength = dataLength;

if (data.length >= 65536) {
if (dataLength >= 65536) {
lpinca marked this conversation as resolved.
Show resolved Hide resolved
offset += 8;
payloadLength = 127;
} else if (data.length > 125) {
} else if (dataLength > 125) {
offset += 2;
payloadLength = 126;
}
Expand Down Expand Up @@ -136,11 +136,11 @@ class Sender {
if (skipMasking) return [target, data];

if (merge) {
applyMask(data, mask, target, offset, data.length);
applyMask(data, mask, target, offset, dataLength);
return [target];
}

applyMask(data, mask, data, 0, data.length);
applyMask(data, mask, data, 0, dataLength);
return [target, data];
}

Expand Down