Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: websockets/ws
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 8.4.1
Choose a base ref
...
head repository: websockets/ws
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 8.4.2
Choose a head ref
  • 2 commits
  • 2 files changed
  • 2 contributors

Commits on Jan 14, 2022

  1. [fix] Use the byte length of the data (#2004)

    Ensure that the correct length is used when framing the data.
    ronag authored Jan 14, 2022
    Copy the full SHA
    0c0754b View commit details
  2. [dist] 8.4.2

    lpinca committed Jan 14, 2022
    Copy the full SHA
    33fd101 View commit details
Showing with 5 additions and 5 deletions.
  1. +4 −4 lib/sender.js
  2. +1 −1 package.json
8 changes: 4 additions & 4 deletions lib/sender.js
Original file line number Diff line number Diff line change
@@ -103,10 +103,10 @@ class Sender {

let payloadLength = dataLength;

if (data.length >= 65536) {
if (dataLength >= 65536) {
offset += 8;
payloadLength = 127;
} else if (data.length > 125) {
} else if (dataLength > 125) {
offset += 2;
payloadLength = 126;
}
@@ -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];
}

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ws",
"version": "8.4.1",
"version": "8.4.2",
"description": "Simple to use, blazing fast and thoroughly tested websocket client and server for Node.js",
"keywords": [
"HyBi",