Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(201)

Unified Diff: third_party/WebKit/Source/core/workers/AbstractWorker.cpp

Issue 2790693002: Split CSP into pre- and post-upgrade checks (Closed)
Patch Set: add unit tests Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/workers/AbstractWorker.cpp
diff --git a/third_party/WebKit/Source/core/workers/AbstractWorker.cpp b/third_party/WebKit/Source/core/workers/AbstractWorker.cpp
index 92850bfdd8fed6ee173c8b60b7aee0f3c3c7637b..d30e0cbfaa5ef25f955212cf333d06101c8d558f 100644
--- a/third_party/WebKit/Source/core/workers/AbstractWorker.cpp
+++ b/third_party/WebKit/Source/core/workers/AbstractWorker.cpp
@@ -70,10 +70,17 @@ KURL AbstractWorker::ResolveURL(const String& url,
if (GetExecutionContext()->GetContentSecurityPolicy() &&
!(GetExecutionContext()
->GetContentSecurityPolicy()
- ->AllowRequestWithoutIntegrity(request_context, script_url) &&
+ ->AllowRequestWithoutIntegrity(
+ request_context, script_url,
+ ResourceRequest::RedirectStatus::kNoRedirect,
+ SecurityViolationReportingPolicy::kReport,
+ kContentSecurityPolicyHeaderTypeEnforce) &&
GetExecutionContext()
->GetContentSecurityPolicy()
- ->AllowWorkerContextFromSource(script_url))) {
+ ->AllowWorkerContextFromSource(
+ script_url, ResourceRequest::RedirectStatus::kNoRedirect,
+ SecurityViolationReportingPolicy::kReport,
+ kContentSecurityPolicyHeaderTypeEnforce))) {
exception_state.ThrowSecurityError(
"Access to the script at '" + script_url.ElidedString() +
"' is denied by the document's Content Security Policy.");

Powered by Google App Engine
This is Rietveld 408576698