Thanks to visit codestin.com Credit goes to github.com
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 2f8395b commit 94ee356Copy full SHA for 94ee356
lib/web/websocket/receiver.js
@@ -12,7 +12,8 @@ const {
12
websocketMessageReceived,
13
utf8Decode,
14
isControlFrame,
15
- isTextBinaryFrame
+ isTextBinaryFrame,
16
+ isContinuationFrame
17
} = require('./util')
18
const { WebsocketFrameSend } = require('./frame')
19
const { closeWebSocketConnection } = require('./connection')
@@ -121,6 +122,11 @@ class ByteParser extends Writable {
121
122
return
123
}
124
125
+ if (isContinuationFrame(opcode) && this.#fragments.length === 0) {
126
+ failWebsocketConnection(this.ws, 'Unexpected continuation frame')
127
+ return
128
+ }
129
+
130
if (payloadLength <= 125) {
131
this.#info.payloadLength = payloadLength
132
this.#state = parserStates.READ_DATA
0 commit comments