Skip to content

Commit 46d3beb

Browse files
authored
Ignore messages from protocol extensions even if it's from an unknown context (#77620)
1 parent dd4ea75 commit 46d3beb

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,10 @@ protected override async Task<bool> AcceptCommand(MessageId id, string method, J
250250
await AttachToTarget(id, token);
251251

252252
if (!contexts.TryGetValue(id, out ExecutionContext context))
253-
return false;
253+
{
254+
// for Dotnetdebugger.* messages, treat them as handled, thus not passing them on to the browser
255+
return method.StartsWith("DotnetDebugger.", StringComparison.OrdinalIgnoreCase);
256+
}
254257

255258
switch (method)
256259
{
@@ -536,11 +539,8 @@ protected override async Task<bool> AcceptCommand(MessageId id, string method, J
536539
}
537540
}
538541

539-
//ignore all protocol extension messages not supported on .net6
540-
if (method.StartsWith("DotnetDebugger.", StringComparison.Ordinal))
541-
return true;
542-
543-
return false;
542+
// for Dotnetdebugger.* messages, treat them as handled, thus not passing them on to the browser
543+
return method.StartsWith("DotnetDebugger.", StringComparison.OrdinalIgnoreCase);
544544
}
545545
private async Task<bool> CallOnFunction(MessageId id, JObject args, CancellationToken token)
546546
{

0 commit comments

Comments
 (0)