Comparing version 7.2.2 to 7.2.3
@@ -113,3 +113,9 @@ 'use strict'; | ||
} else { | ||
buf = Buffer.allocUnsafe(2 + Buffer.byteLength(data)); | ||
const length = Buffer.byteLength(data); | ||
if (length > 123) { | ||
throw new RangeError('The message must not be greater than 123 bytes'); | ||
} | ||
buf = Buffer.allocUnsafe(2 + length); | ||
buf.writeUInt16BE(code, 0); | ||
@@ -158,2 +164,6 @@ buf.write(data, 2); | ||
if (buf.length > 125) { | ||
throw new RangeError('The data size must not be greater than 125 bytes'); | ||
} | ||
if (this._deflating) { | ||
@@ -199,2 +209,6 @@ this.enqueue([this.doPing, buf, mask, toBuffer.readOnly, cb]); | ||
if (buf.length > 125) { | ||
throw new RangeError('The data size must not be greater than 125 bytes'); | ||
} | ||
if (this._deflating) { | ||
@@ -201,0 +215,0 @@ this.enqueue([this.doPong, buf, mask, toBuffer.readOnly, cb]); |
{ | ||
"name": "ws", | ||
"version": "7.2.2", | ||
"version": "7.2.3", | ||
"description": "Simple to use, blazing fast and thoroughly tested websocket client and server for Node.js", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
109814
3073