We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5b197ca commit c55679aCopy full SHA for c55679a
1 file changed
lib/websocket/driver/hybi.js
@@ -452,7 +452,12 @@ var instance = {
452
if (error) return this._fail('extension_error', error.message);
453
454
var payload = message.data;
455
- if (message.opcode === this.OPCODES.text) payload = this._encode(payload);
+
456
+ if (payload.length > this._maxLength)
457
+ return this._fail('too_large', 'WebSocket frame length too large');
458
459
+ if (message.opcode === this.OPCODES.text)
460
+ payload = this._encode(payload);
461
462
if (payload === null)
463
return this._fail('encoding_error', 'Could not decode a text frame as UTF-8');
0 commit comments