summaryrefslogtreecommitdiffstats
path: root/dom
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-06-23 04:30:08 +0200
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-06-23 04:30:08 +0200
commit0097345ad9aa859dcf02cb0ba80685d51bc7ec16 (patch)
tree0b5289dc24d1d1a6006fdafb807e45369a666d57 /dom
parentd413e1fb87779a0c3f474f8e773e01ad0878beea (diff)
downloadUXP-0097345ad9aa859dcf02cb0ba80685d51bc7ec16.tar
UXP-0097345ad9aa859dcf02cb0ba80685d51bc7ec16.tar.gz
UXP-0097345ad9aa859dcf02cb0ba80685d51bc7ec16.tar.lz
UXP-0097345ad9aa859dcf02cb0ba80685d51bc7ec16.tar.xz
UXP-0097345ad9aa859dcf02cb0ba80685d51bc7ec16.zip
Bug 1469150 - CSP: Scripts with valid nonce get blocked if URL redirects is fixed (follow up)
Diffstat (limited to 'dom')
-rw-r--r--dom/security/nsCSPService.cpp4
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