Fix protocol filtering of net.request
net::URLRequest inherits from base::SupportsUserData, which allows associating arbitrary data with the request. Use this mechanism as a condition for filtering requests from custom protocols. Close #11657
This commit is contained in:
parent
78ccfa0612
commit
bc76f35691
4 changed files with 18 additions and 4 deletions
|
@ -78,10 +78,6 @@ 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