Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/cdp-proxy/reactNativeCDPProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,14 @@ export class ReactNativeCDPProxy {
Connection,
IncomingMessage,
]): Promise<void> {
// Only allow connections without an Origin header (i.e., from vscode-js-debug's
// raw WebSocket client). Browser-initiated WebSocket connections always include
// an Origin header and should be rejected.
if (request.headers.origin) {
debuggerTarget.close();
return;
}

this.debuggerTarget = debuggerTarget;

this.debuggerTarget.pause(); // don't listen for events until the target is ready
Expand Down
Loading