browser(firefox): fix redirect interception (#2672)

We sometimes receive shouldIntercept for redirects,
and should not issue sendOnRequest for the second time.
This commit is contained in:
Dmitry Gozman 2020-06-22 15:57:05 -07:00 committed by GitHub
parent bb34418095
commit 3d49af2537
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 5 deletions

View file

@ -1 +1 @@
1114
1115

View file

@ -320,6 +320,12 @@ class NetworkRequest {
return false;
}
// We do not want to intercept any redirects, because we are not able
// to intercept subresource redirects, and it's unreliable for main requests.
// We do not sendOnRequest here, because redirects do that in constructor.
if (this.redirectedFromId)
return false;
const shouldIntercept = this._shouldIntercept();
if (!shouldIntercept) {
// We are not intercepting - ready to issue onRequest.
@ -424,10 +430,6 @@ class NetworkRequest {
}
_shouldIntercept() {
// We do not want to intercept any redirects, because we are not able
// to intercept subresource redirects.
if (this.redirectedFromId)
return false;
const pageNetwork = this._activePageNetwork();
if (!pageNetwork)
return false;