browser(firefox): stop faking intercepting redirects (#2618)

We just cannot do it, so we report redirects as intercepted: false.
This commit is contained in:
Dmitry Gozman 2020-06-18 10:40:34 -07:00 коммит произвёл GitHub
Родитель 02704e08c8
Коммит c544bffee3
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 2 добавлений и 15 удалений

Просмотреть файл

@ -1 +1 @@
1112
1113

Просмотреть файл

@ -334,23 +334,10 @@ class NetworkObserver {
const requestId = this._requestId(httpChannel);
const isRedirect = this._redirectMap.has(requestId);
const interceptionEnabled = this._isInterceptionEnabledForPage(pageNetwork);
if (!interceptionEnabled) {
if (!interceptionEnabled || isRedirect) {
new NotificationCallbacks(this, pageNetwork, httpChannel, false);
this._sendOnRequest(httpChannel, false);
new ResponseBodyListener(this, pageNetwork, httpChannel);
} else if (isRedirect) {
// We pretend that redirect is interceptable in the protocol, although it's actually not
// and therefore we do not instantiate the interceptor.
// TODO: look into REDIRECT_MODE_MANUAL.
const interceptors = pageNetwork._ensureInterceptors();
interceptors.set(requestId, {
_resume: () => {},
_abort: () => {},
_fulfill: () => {},
});
new NotificationCallbacks(this, pageNetwork, httpChannel, false);
this._sendOnRequest(httpChannel, true);
new ResponseBodyListener(this, pageNetwork, httpChannel);
} else {
const previousCallbacks = httpChannel.notificationCallbacks;
if (previousCallbacks instanceof Ci.nsIInterfaceRequestor) {