diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-06-23 04:30:08 +0200 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-06-23 04:30:08 +0200 |
commit | c9572541003234b67a9ca76b9da6a2bb791ceb6a (patch) | |
tree | 0b5289dc24d1d1a6006fdafb807e45369a666d57 /dom/security/nsCSPService.cpp | |
parent | c182d2d6bd02d4fc4df355b69c7bb7c3ae8f246d (diff) | |
download | aura-central-c9572541003234b67a9ca76b9da6a2bb791ceb6a.tar.gz |
Bug 1469150 - CSP: Scripts with valid nonce get blocked if URL redirects is fixed (follow up)
Diffstat (limited to 'dom/security/nsCSPService.cpp')
-rw-r--r-- | dom/security/nsCSPService.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/dom/security/nsCSPService.cpp b/dom/security/nsCSPService.cpp index f9186b309..4807c9aa4 100644 --- a/dom/security/nsCSPService.cpp +++ b/dom/security/nsCSPService.cpp @@ -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 |