зеркало из https://github.com/mozilla/gecko-dev.git
Bug 985135 - When owner is a null principal, propagate to replacement channel on redirect. r=bz
This commit is contained in:
Родитель
fe5e0f327b
Коммит
742337c540
|
@ -15,6 +15,7 @@
|
|||
#include "nsNetUtil.h"
|
||||
|
||||
#include "nsICachingChannel.h"
|
||||
#include "nsIPrincipal.h"
|
||||
#include "nsISeekableStream.h"
|
||||
#include "nsITimedChannel.h"
|
||||
#include "nsIEncodedChannel.h"
|
||||
|
@ -1858,6 +1859,13 @@ HttpBaseChannel::SetupReplacementChannel(nsIURI *newURI,
|
|||
newChannel->SetNotificationCallbacks(mCallbacks);
|
||||
newChannel->SetLoadFlags(newLoadFlags);
|
||||
|
||||
// If our owner is a null principal it will have been set as a security
|
||||
// measure, so we want to propagate it to the new channel.
|
||||
nsCOMPtr<nsIPrincipal> ownerPrincipal = do_QueryInterface(mOwner);
|
||||
if (ownerPrincipal && ownerPrincipal->GetIsNullPrincipal()) {
|
||||
newChannel->SetOwner(mOwner);
|
||||
}
|
||||
|
||||
// Try to preserve the privacy bit if it has been overridden
|
||||
if (mPrivateBrowsingOverriden) {
|
||||
nsCOMPtr<nsIPrivateBrowsingChannel> newPBChannel =
|
||||
|
|
Загрузка…
Ссылка в новой задаче