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

Unified Diff: third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.cpp

Issue 2551893002: Upgrade-Insecure-Requests: Split CSP checks into pre-upgrade and post-upgrade.
Patch Set: Created 4 years 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
« no previous file with comments | « third_party/WebKit/Source/core/workers/AbstractWorker.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4dd20215f9464f89778892f0394d1c22daa38a33..9966ed5917eccb90d2e4e80a841e35f20a9368f0 100644
--- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.cpp
+++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.cpp
@@ -308,10 +308,14 @@ void ServiceWorkerContainer::registerServiceWorkerImpl(
ContentSecurityPolicy* csp = executionContext->contentSecurityPolicy();
if (csp) {
if (!(csp->allowRequestWithoutIntegrity(
- WebURLRequest::RequestContextServiceWorker, scriptURL) &&
+ WebURLRequest::RequestContextServiceWorker, scriptURL,
+ ResourceRequest::RedirectStatus::NoRedirect,
+ ContentSecurityPolicy::SendReport,
+ ContentSecurityPolicyHeaderTypeEnforce) &&
csp->allowWorkerContextFromSource(
scriptURL, ResourceRequest::RedirectStatus::NoRedirect,
- ContentSecurityPolicy::SendReport))) {
+ ContentSecurityPolicy::SendReport,
+ ContentSecurityPolicyHeaderTypeEnforce))) {
callbacks->onError(WebServiceWorkerError(
WebServiceWorkerError::ErrorTypeSecurity,
String(
« no previous file with comments | « third_party/WebKit/Source/core/workers/AbstractWorker.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698