mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-07 16:28:38 +09:00
Bug 1469150 - CSP: Scripts with valid nonce get blocked if URL redirects is fixed (follow up)
This commit is contained in:
parent
a6d927b167
commit
53c39834e6
1 changed files with 2 additions and 2 deletions
|
|
@ -288,6 +288,7 @@ CSPService::AsyncOnChannelRedirect(nsIChannel *oldChannel,
|
|||
nsContentUtils::InternalContentPolicyTypeToExternalOrWorker(policyType);
|
||||
|
||||
int16_t aDecision = nsIContentPolicy::ACCEPT;
|
||||
nsCOMPtr<nsISupports> requestContext = loadInfo->GetLoadingContext();
|
||||
// 1) Apply speculative CSP for preloads
|
||||
if (isPreload) {
|
||||
nsCOMPtr<nsIContentSecurityPolicy> preloadCsp;
|
||||
|
|
@ -298,7 +299,7 @@ CSPService::AsyncOnChannelRedirect(nsIChannel *oldChannel,
|
|||
preloadCsp->ShouldLoad(policyType, // load type per nsIContentPolicy (uint32_t)
|
||||
newUri, // nsIURI
|
||||
nullptr, // nsIURI
|
||||
nullptr, // nsISupports
|
||||
requestContext, // nsISupports
|
||||
EmptyCString(), // ACString - MIME guess
|
||||
originalUri, // aExtra
|
||||
&aDecision);
|
||||
|
|
@ -317,7 +318,6 @@ 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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue