Bug 1556308 - Prevent nemonitor errors for failed requests r=Honza

Differential Revision: https://phabricator.services.mozilla.com/D33988

--HG--
extra : moz-landing-system : lando
This commit is contained in:
David Walsh 2019-06-10 16:16:08 +00:00
Родитель 70755e0b8c
Коммит e5f1dbe9cf
1 изменённых файлов: 4 добавлений и 2 удалений

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

@ -293,6 +293,8 @@ NetworkObserver.prototype = {
return;
}
const blockedOrFailed = topic === "http-on-failed-opening-request";
const channel = subject.QueryInterface(Ci.nsIHttpChannel);
if (!matchRequest(channel, this.filters)) {
@ -308,7 +310,7 @@ NetworkObserver.prototype = {
const setCookieHeaders = [];
if (!blockedReason) {
if (!blockedOrFailed) {
channel.visitOriginalResponseHeaders({
visitHeader: function(name, value) {
const lowerName = name.toLowerCase();
@ -337,7 +339,7 @@ NetworkObserver.prototype = {
const httpVersionMin = {};
channel.QueryInterface(Ci.nsIHttpChannelInternal);
if (!blockedReason) {
if (!blockedOrFailed) {
channel.getResponseVersion(httpVersionMaj, httpVersionMin);
response.status = channel.responseStatus;