Skip to content

Commit

Permalink
fix: ProxyWebSocket hitting DCHECK
Browse files Browse the repository at this point in the history
  • Loading branch information
sentialx committed Apr 6, 2020
1 parent 3c06852 commit 89e3517
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions shell/browser/electron_browser_client.cc
Expand Up @@ -1319,7 +1319,7 @@ bool ElectronBrowserClient::WillInterceptWebSocket(
if (web_request_api)
return web_request->HasListener() || web_request_api->MayHaveProxies();
#endif

return web_request->HasListener();
}

Expand All @@ -1341,9 +1341,12 @@ void ElectronBrowserClient::CreateWebSocket(
browser_context);

DCHECK(web_request_api);
web_request_api->ProxyWebSocket(frame, std::move(factory), url,
site_for_cookies.RepresentativeUrl(),
user_agent, std::move(handshake_client));

if (web_request_api->MayHaveProxies()) {
web_request_api->ProxyWebSocket(frame, std::move(factory), url,
site_for_cookies.RepresentativeUrl(),
user_agent, std::move(handshake_client));
}
#endif

auto web_request = api::WebRequest::FromOrCreate(isolate, browser_context);
Expand Down

0 comments on commit 89e3517

Please sign in to comment.