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

Unified Diff: content/browser/frame_host/navigator_impl.cc

Issue 1957783002: Replicate Content-Security-Policy into remote frame proxies. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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: content/browser/frame_host/navigator_impl.cc
diff --git a/content/browser/frame_host/navigator_impl.cc b/content/browser/frame_host/navigator_impl.cc
index e9d4f7bb2c6742cc9dd855f703f50553376997a8..8a41ab50310b16388e01588431d25c8ea5ed2c74 100644
--- a/content/browser/frame_host/navigator_impl.cc
+++ b/content/browser/frame_host/navigator_impl.cc
@@ -512,6 +512,11 @@ void NavigatorImpl::DidNavigate(
render_frame_host->frame_tree_node()->SetCurrentOrigin(
params.origin, params.has_potentially_trustworthy_unique_origin);
+ // Navigating to a new location means a new, fresh set of http headers and/or
+ // <meta> elements - we need to reset CSP policy to an empty set.
+ if (!is_navigation_within_page)
+ render_frame_host->frame_tree_node()->ResetContentSecurityPolicy();
+
render_frame_host->frame_tree_node()->SetEnforceStrictMixedContentChecking(
params.should_enforce_strict_mixed_content_checking);

Powered by Google App Engine
This is Rietveld 408576698