MCPcopy Index your code
hub / github.com/nodejs/node / validateHandshake

Function validateHandshake

lib/internal/debugger/inspect_client.js:53–64  ·  view source on GitHub ↗
(requestKey, responseKey)

Source from the content-addressed store, hash-verified

51}
52
53function 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
66function encodeFrameHybi17(payload) {
67 const dataLength = payload.length;

Callers 1

handshakeListenerMethod · 0.85

Calls 2

updateMethod · 0.65
toStringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…