Bug 1283379 - have RESTRequest log on channel redirect. r?tcsc draft
authorMark Hammond <mhammond@skippinet.com.au>
Thu, 30 Jun 2016 17:15:35 +1000
changeset 382698 571a2a6f770dc58c845239b7f21de8190a834d00
parent 381441 110c7ad7d399d16b9c77940f766a26df5d90f881
child 524270 b1eeb38b6587c0b0cf86b0f29f9ccb3760906bc4
push id21803
push userbmo:markh@mozilla.com
push dateThu, 30 Jun 2016 07:15:50 +0000
reviewerstcsc
bugs1283379
milestone50.0a1
Bug 1283379 - have RESTRequest log on channel redirect. r?tcsc MozReview-Commit-ID: 5QakocdCw7k
services/common/rest.js
--- a/services/common/rest.js
+++ b/services/common/rest.js
@@ -600,16 +600,20 @@ RESTRequest.prototype = {
                     newChannel.URI.spec + ", internal = " + isInternal);
     return isInternal && isSameURI;
   },
 
   /*** nsIChannelEventSink ***/
   asyncOnChannelRedirect:
     function asyncOnChannelRedirect(oldChannel, newChannel, flags, callback) {
 
+    let oldSpec = (oldChannel && oldChannel.URI) ? oldChannel.URI.spec : "<undefined>";
+    let newSpec = (newChannel && newChannel.URI) ? newChannel.URI.spec : "<undefined>";
+    this._log.debug("Channel redirect: " + oldSpec + ", " + newSpec + ", " + flags);
+
     try {
       newChannel.QueryInterface(Ci.nsIHttpChannel);
     } catch (ex) {
       this._log.error("Unexpected error: channel not nsIHttpChannel!");
       callback.onRedirectVerifyCallback(Cr.NS_ERROR_NO_INTERFACE);
       return;
     }