This commit is contained in:
bzbarsky@mit.edu 2007-09-26 09:52:33 -07:00
Родитель 83ad6c43d6
Коммит e2c308b507
1 изменённых файлов: 6 добавлений и 6 удалений

Просмотреть файл

@ -852,13 +852,13 @@ nsScriptLoader::PrepareLoadedRequest(nsScriptLoadRequest* aRequest,
// the script has a non-cert principal, the document's principal should be // the script has a non-cert principal, the document's principal should be
// downgraded. // downgraded.
if (channel) { if (channel) {
nsCOMPtr<nsISupports> owner; nsCOMPtr<nsIPrincipal> channelPrincipal;
channel->GetOwner(getter_AddRefs(owner)); nsContentUtils::GetSecurityManager()->
nsCOMPtr<nsIPrincipal> principal = do_QueryInterface(owner); GetChannelPrincipal(channel, getter_AddRefs(channelPrincipal));
if (channelPrincipal) {
if (principal) {
nsCOMPtr<nsIPrincipal> newPrincipal = nsCOMPtr<nsIPrincipal> newPrincipal =
MaybeDowngradeToCodebase(mDocument->NodePrincipal(), principal); MaybeDowngradeToCodebase(mDocument->NodePrincipal(),
channelPrincipal);
mDocument->SetPrincipal(newPrincipal); mDocument->SetPrincipal(newPrincipal);
} }