Bug 1544534: Add carveout for NullPrincipal when asserting if explicit CSP and CSP on Principal are equal. r=Gijs

Differential Revision: https://phabricator.services.mozilla.com/D27700

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Christoph Kerschbaumer 2019-04-16 14:19:44 +00:00
parent 2cfb84082d
commit aee4945e49

View File

@ -9900,8 +9900,11 @@ nsresult nsDocShell::DoURILoad(nsDocShellLoadState* aLoadState,
nsCOMPtr<nsIContentSecurityPolicy> csp;
aLoadState->TriggeringPrincipal()->GetCsp(getter_AddRefs(csp));
#ifdef DEBUG
nsCOMPtr<nsIContentSecurityPolicy> argsCSP = aLoadState->Csp();
MOZ_ASSERT(nsCSPContext::Equals(csp, argsCSP));
if (!aLoadState->TriggeringPrincipal()->GetIsNullPrincipal()) {
// After Bug 965637 we can remove that assertion anyway.
nsCOMPtr<nsIContentSecurityPolicy> argsCSP = aLoadState->Csp();
MOZ_ASSERT(nsCSPContext::Equals(csp, argsCSP));
}
#endif
if (csp) {