Stop allowing electron.net
requests to be intercepted.
Not very useful to intercept requests from `electron.net`, since both the interception machinery and `electron.net` live in the browser process.
This commit is contained in:
parent
32113bf7f9
commit
6b2ddc4814
1 changed files with 4 additions and 0 deletions
|
@ -78,6 +78,10 @@ class Protocol : public mate::TrackableObject<Protocol> {
|
|||
net::URLRequestJob* MaybeCreateJob(
|
||||
net::URLRequest* request,
|
||||
net::NetworkDelegate* network_delegate) const override {
|
||||
if (!request->initiator().has_value()) {
|
||||
// Don't intercept this request as it was created by `net.request`.
|
||||
return nullptr;
|
||||
}
|
||||
RequestJob* request_job = new RequestJob(request, network_delegate);
|
||||
request_job->SetHandlerInfo(isolate_, request_context_.get(), handler_);
|
||||
return request_job;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue