Bug 1267033 - Ensure QI to nsIHttpChannel before trying to merge status info. r=kmag
authorGiorgio Maone <g.maone@informaction.com>
Wed, 27 Apr 2016 18:11:32 +0200
changeset 357665 6cc094eba698eb8f9faa9d5eea6a3c5f22597b10
parent 357664 5e63ffa2d608dc6fb76fe8e26e21bbdd5b55bfae
child 357666 b4dfa9f7f63cd920d559bcb64934326c3a2c9bee
push id16816
push userbmo:gasolin@mozilla.com
push dateFri, 29 Apr 2016 03:33:20 +0000
reviewerskmag
bugs1267033
milestone49.0a1
Bug 1267033 - Ensure QI to nsIHttpChannel before trying to merge status info. r=kmag MozReview-Commit-ID: 5kZndCaQmPr
toolkit/modules/addons/WebRequest.jsm
--- a/toolkit/modules/addons/WebRequest.jsm
+++ b/toolkit/modules/addons/WebRequest.jsm
@@ -500,20 +500,22 @@ HttpObserverManager = {
     let loadInfo = channel.loadInfo;
     let policyType = loadInfo ?
                      loadInfo.externalContentPolicyType :
                      Ci.nsIContentPolicy.TYPE_OTHER;
 
     let requestHeaderNames;
     let responseHeaderNames;
 
-    let includeStatus = kind === "headersReceived" ||
-                        kind === "onRedirect" ||
-                        kind === "onStart" ||
-                        kind === "onStop";
+    let includeStatus = (
+                          kind === "headersReceived" ||
+                          kind === "onRedirect" ||
+                          kind === "onStart" ||
+                          kind === "onStop"
+                        ) && channel instanceof Ci.nsIHttpChannel;
 
     let commonData = null;
     let uri = channel.URI;
     for (let [callback, opts] of listeners.entries()) {
       if (!this.shouldRunListener(policyType, uri, opts.filter)) {
         continue;
       }