(requestKey, responseKey)
| 51 | } |
| 52 | |
| 53 | function validateHandshake(requestKey, responseKey) { |
| 54 | const expectedResponseKeyBase = requestKey + WEBSOCKET_HANDSHAKE_GUID; |
| 55 | const shasum = crypto.createHash('sha1'); |
| 56 | shasum.update(expectedResponseKeyBase); |
| 57 | const shabuf = shasum.digest(); |
| 58 | |
| 59 | if (shabuf.toString('base64') !== responseKey) { |
| 60 | throw new ERR_DEBUGGER_ERROR( |
| 61 | `WebSocket secret mismatch: ${requestKey} did not match ${responseKey}`, |
| 62 | ); |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | function encodeFrameHybi17(payload) { |
| 67 | const dataLength = payload.length; |
no test coverage detected
searching dependent graphs…