Skip to content

Commit b577679

Browse files
huntiefacebook-github-bot
authored andcommitted
Update DevTools windowKey to a sha256 hash (#53923)
Summary: Pull Request resolved: #53923 Motivated by feedback on D83070252. This prevents us from including decodable information about debug targets in these values. Changelog: [Internal] Reviewed By: motiz88 Differential Revision: D83139401 fbshipit-source-id: 01b01d23e4dfb06e400729b8cedf1fe2e098b209
1 parent 88f05b2 commit b577679

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

packages/dev-middleware/src/middleware/openDebuggerMiddleware.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import type {NextHandleFunction} from 'connect';
2121
import type {IncomingMessage, ServerResponse} from 'http';
2222

2323
import getDevToolsFrontendUrl from '../utils/getDevToolsFrontendUrl';
24+
import {createHash} from 'crypto';
2425
import url from 'url';
2526

2627
const LEGACY_SYNTHETIC_PAGE_TITLE =
@@ -190,11 +191,15 @@ export default function openDebuggerMiddleware({
190191
}
191192
}
192193
if (shouldUseStandaloneFuseboxShell) {
193-
const windowKey = [
194-
serverBaseUrl,
195-
target.webSocketDebuggerUrl,
196-
target.appId,
197-
].join('-');
194+
const windowKey = createHash('sha256')
195+
.update(
196+
[
197+
serverBaseUrl,
198+
target.webSocketDebuggerUrl,
199+
target.appId,
200+
].join('-'),
201+
)
202+
.digest('hex');
198203
if (!browserLauncher.unstable_showFuseboxShell) {
199204
throw new Error(
200205
'Fusebox shell is not supported by the current browser launcher',

0 commit comments

Comments
 (0)