Bug 1469150 - CSP: Scripts with valid nonce get blocked if URL redirects

https://bugzilla.mozilla.org/show_bug.cgi?id=1469150
This commit is contained in:
janekptacijarabaci 2018-06-21 20:57:09 +02:00 committed by Roy Tam
commit c8131a687a
5 changed files with 100 additions and 1 deletions

View file

@ -317,11 +317,12 @@ CSPService::AsyncOnChannelRedirect(nsIChannel *oldChannel,
loadInfo->LoadingPrincipal()->GetCsp(getter_AddRefs(csp));
if (csp) {
nsCOMPtr<nsISupports> requestContext = loadInfo->GetLoadingContext();
// Pass originalURI as aExtra to indicate the redirect
csp->ShouldLoad(policyType, // load type per nsIContentPolicy (uint32_t)
newUri, // nsIURI
nullptr, // nsIURI
nullptr, // nsISupports
requestContext, // nsISupports
EmptyCString(), // ACString - MIME guess
originalUri, // aExtra
&aDecision);