@@ -172,29 +172,11 @@ bool subjectToCSP(nsIURI* aURI, nsContentPolicyType aContentType) {
172
172
nsCOMPtr<nsIContentSecurityPolicy> csp = aLoadInfo->GetCsp ();
173
173
174
174
if (csp) {
175
- // Generally aOriginalURI denotes the URI before a redirect and hence
176
- // will always be a nullptr here. Only exception are frame navigations
177
- // which we want to treat as a redirect for the purpose of CSP reporting
178
- // and in particular the `blocked-uri` in the CSP report where we want
179
- // to report the prePath information.
180
- nsCOMPtr<nsIURI> originalURI = nullptr ;
181
- ExtContentPolicyType extType =
182
- nsContentUtils::InternalContentPolicyTypeToExternal (contentType);
183
- if (extType == ExtContentPolicy::TYPE_SUBDOCUMENT &&
184
- !aLoadInfo->GetOriginalFrameSrcLoad ()) {
185
- nsAutoCString prePathStr;
186
- nsresult rv = aContentLocation->GetPrePath (prePathStr);
187
- NS_ENSURE_SUCCESS (rv, rv);
188
- rv = NS_NewURI(getter_AddRefs (originalURI), prePathStr);
189
- NS_ENSURE_SUCCESS (rv, rv);
190
- }
191
-
192
175
// obtain the enforcement decision
193
- rv = csp->ShouldLoad (
194
- contentType, cspEventListener, aContentLocation,
195
- originalURI, // no redirect, unless it's a frame navigation.
196
- !isPreload && aLoadInfo->GetSendCSPViolationEvents (), cspNonce,
197
- parserCreatedScript, aDecision);
176
+ rv = csp->ShouldLoad (contentType, cspEventListener, aContentLocation,
177
+ nullptr , // no redirect, aOriginal URL is null.
178
+ !isPreload && aLoadInfo->GetSendCSPViolationEvents (),
179
+ cspNonce, parserCreatedScript, aDecision);
198
180
199
181
if (NS_CP_REJECTED(*aDecision)) {
200
182
NS_SetRequestBlockingReason (
0 commit comments