| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 7203924 commit 96147c9
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -53,6 +53,7 @@ function sendEnd(socket) { | |||
| 53 | 53 | } | |
| 54 | 54 | ||
| 55 | 55 | function parseWSFrame(buffer, handler) { | |
| 56 | + // Protocol described in https://tools.ietf.org/html/rfc6455#section-5 | ||
| 56 | 57 | if (buffer.length < 2) | |
| 57 | 58 | return 0; | |
| 58 | 59 | if (buffer[0] === 0x88 && buffer[1] === 0x00) { | |
@@ -68,7 +69,8 @@ function parseWSFrame(buffer, handler) { | |||
| 68 | 69 | dataLen = buffer.readUInt16BE(2); | |
| 69 | 70 | bodyOffset = 4; | |
| 70 | 71 | } else if (dataLen === 127) { | |
| 71 | - dataLen = buffer.readUInt32BE(2); | ||
| 72 | + assert(buffer[2] === 0 && buffer[3] === 0, 'Inspector message too big'); | ||
| 73 | + dataLen = buffer.readUIntBE(4, 6); | ||
| 72 | 74 | bodyOffset = 10; | |
| 73 | 75 | } | |
| 74 | 76 | if (buffer.length < bodyOffset + dataLen) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments