зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1088617 - Handle nsIURIWithPrincipal in nsPrincipal::CheckMayLoad. r=bz
This mimics the logic already inside nsNullPrincipal::CheckMayLoad.
This commit is contained in:
Родитель
5db861cb4a
Коммит
a8cf8ea9c3
|
@ -346,6 +346,18 @@ nsPrincipal::CheckMayLoad(nsIURI* aURI, bool aReport, bool aAllowIfInheritsPrinc
|
|||
}
|
||||
}
|
||||
|
||||
// See if aURI is something like a Blob URI that is actually associated with
|
||||
// a principal.
|
||||
nsCOMPtr<nsIURIWithPrincipal> uriWithPrin = do_QueryInterface(aURI);
|
||||
if (uriWithPrin) {
|
||||
nsCOMPtr<nsIPrincipal> uriPrin;
|
||||
uriWithPrin->GetPrincipal(getter_AddRefs(uriPrin));
|
||||
MOZ_ASSERT(uriPrin);
|
||||
if (nsIPrincipal::Subsumes(uriPrin)) {
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
|
||||
if (nsScriptSecurityManager::SecurityCompareURIs(mCodebase, aURI)) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче