|
|
|
@ -2042,34 +2042,28 @@ var httpObserver = {
|
|
|
|
|
|
|
|
|
|
// contentPolicy.shouldLoad doesn't detect redirects, this needs to be used
|
|
|
|
|
asyncOnChannelRedirect: function(oldChannel, newChannel, flags, callback) {
|
|
|
|
|
var result = this.ACCEPT;
|
|
|
|
|
|
|
|
|
|
// If error thrown, the redirect will fail
|
|
|
|
|
try {
|
|
|
|
|
var URI = newChannel.URI;
|
|
|
|
|
|
|
|
|
|
if ( !URI.schemeIs('http') && !URI.schemeIs('https') ) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var channelData = this.channelDataFromChannel(oldChannel);
|
|
|
|
|
if ( channelData === null ) {
|
|
|
|
|
if ( newChannel instanceof Ci.nsIWritablePropertyBag === false ) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( this.handleRequest(newChannel, URI, channelData[0], channelData[1]) ) {
|
|
|
|
|
result = this.ABORT;
|
|
|
|
|
var channelData = this.channelDataFromChannel(oldChannel);
|
|
|
|
|
if ( channelData === null ) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Carry the data on in case of multiple redirects
|
|
|
|
|
if ( newChannel instanceof Ci.nsIWritablePropertyBag ) {
|
|
|
|
|
newChannel.setProperty(this.REQDATAKEY, channelData);
|
|
|
|
|
}
|
|
|
|
|
newChannel.setProperty(this.REQDATAKEY, channelData);
|
|
|
|
|
} catch (ex) {
|
|
|
|
|
// console.error(ex);
|
|
|
|
|
} finally {
|
|
|
|
|
callback.onRedirectVerifyCallback(result);
|
|
|
|
|
callback.onRedirectVerifyCallback(this.ACCEPT);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|