зеркало из https://github.com/mozilla/gecko-dev.git
Bug 806494 - Part 1: additional logging and safety for header copying. r=gps
This commit is contained in:
Родитель
a0f7ee362b
Коммит
e5f7a50a99
|
@ -613,15 +613,22 @@ ChannelNotificationListener.prototype = {
|
||||||
let newSpec = (newChannel && newChannel.URI) ? newChannel.URI.spec : "<undefined>";
|
let newSpec = (newChannel && newChannel.URI) ? newChannel.URI.spec : "<undefined>";
|
||||||
this._log.debug("Channel redirect: " + oldSpec + ", " + newSpec + ", " + flags);
|
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.
|
// For internal redirects, copy the headers that our caller set.
|
||||||
try {
|
try {
|
||||||
if ((flags & Ci.nsIChannelEventSink.REDIRECT_INTERNAL) &&
|
if ((flags & Ci.nsIChannelEventSink.REDIRECT_INTERNAL) &&
|
||||||
newChannel.URI.equals(oldChannel.URI)) {
|
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) {
|
for (let header of this._headersToCopy) {
|
||||||
let value = oldChannel.getRequestHeader(header);
|
let value = oldChannel.getRequestHeader(header);
|
||||||
if (value) {
|
if (value) {
|
||||||
|
let printed = (header == "authorization") ? "****" : value;
|
||||||
|
this._log.debug("Header: " + header + " = " + printed);
|
||||||
newChannel.setRequestHeader(header, value);
|
newChannel.setRequestHeader(header, value);
|
||||||
|
} else {
|
||||||
|
this._log.warn("No value for header " + header);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче