From b76d63e705a6a56735d7645fae57e38c05fa7141 Mon Sep 17 00:00:00 2001 From: Richard Newman Date: Tue, 18 Dec 2012 11:43:58 -0800 Subject: [PATCH] Bug 806494 - Part 1: additional logging and safety for header copying. r=gps --- services/sync/modules/resource.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/services/sync/modules/resource.js b/services/sync/modules/resource.js index d318f446b38..75b95ad3435 100644 --- a/services/sync/modules/resource.js +++ b/services/sync/modules/resource.js @@ -613,15 +613,22 @@ ChannelNotificationListener.prototype = { let newSpec = (newChannel && newChannel.URI) ? newChannel.URI.spec : ""; this._log.debug("Channel redirect: " + oldSpec + ", " + newSpec + ", " + flags); + this._log.debug("Ensuring load flags are set."); + newChannel.loadFlags |= DEFAULT_LOAD_FLAGS; + // For internal redirects, copy the headers that our caller set. try { if ((flags & Ci.nsIChannelEventSink.REDIRECT_INTERNAL) && newChannel.URI.equals(oldChannel.URI)) { - this._log.trace("Copying headers for safe internal redirect."); + this._log.debug("Copying headers for safe internal redirect."); for (let header of this._headersToCopy) { let value = oldChannel.getRequestHeader(header); if (value) { + let printed = (header == "authorization") ? "****" : value; + this._log.debug("Header: " + header + " = " + printed); newChannel.setRequestHeader(header, value); + } else { + this._log.warn("No value for header " + header); } } }