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

Unified Diff: third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.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/modules/serviceworkers/ServiceWorkerContainer.cpp
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.cpp
index 87ceca0eaae9fe283357b4c7552698af58cc8fb1..83630936aa5289b6138d6583689b378636dd9260 100644
--- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.cpp
+++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.cpp
@@ -246,10 +246,14 @@ void ServiceWorkerContainer::RegisterServiceWorkerImpl(
ContentSecurityPolicy* csp = execution_context->GetContentSecurityPolicy();
if (csp) {
if (!(csp->AllowRequestWithoutIntegrity(
- WebURLRequest::kRequestContextServiceWorker, script_url) &&
+ WebURLRequest::kRequestContextServiceWorker, script_url,
+ ResourceRequest::RedirectStatus::kNoRedirect,
+ SecurityViolationReportingPolicy::kReport,
+ kContentSecurityPolicyHeaderTypeEnforce) &&
csp->AllowWorkerContextFromSource(
script_url, ResourceRequest::RedirectStatus::kNoRedirect,
- SecurityViolationReportingPolicy::kReport))) {
+ SecurityViolationReportingPolicy::kReport,
+ kContentSecurityPolicyHeaderTypeEnforce))) {
callbacks->OnError(WebServiceWorkerError(
WebServiceWorkerError::kErrorTypeSecurity,
String(

Powered by Google App Engine
This is Rietveld 408576698