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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2689653003: PlzNavigate: Enforce 'form-action' CSP on the browser-side. (Closed)
Patch Set: PlzNavigate: Enforce 'form-action' CSP on the browser-side. Created 3 years, 10 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/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index f65c5b666138d903af0dfc162fdaa37d6b022568..5d915ef6ea7a299a7d7b5e97c668c58116586de4 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -6310,6 +6310,11 @@ void RenderFrameImpl::BeginNavigation(const NavigationPolicyInfo& info) {
net::LOAD_ONLY_FROM_CACHE | net::LOAD_DISABLE_CACHE);
load_flags |= net::LOAD_BYPASS_CACHE;
}
+
+ bool is_form_submission =
+ info.navigationType == blink::WebNavigationTypeFormSubmitted ||
+ info.navigationType == blink::WebNavigationTypeFormSubmitted;
Mike West 2017/02/22 15:36:08 This seems like you pasted the same thing twice. D
arthursonzogni 2017/02/22 17:15:23 Oops, thanks! Ack for the test. I assume that a fo
alexmos 2017/02/28 02:48:46 Again, can't speak for Mike, but there's a Blink u
arthursonzogni 2017/03/07 16:25:51 I will add a test with an allowed form submission
+
BeginNavigationParams begin_navigation_params(
GetWebURLRequestHeaders(info.urlRequest), load_flags,
info.urlRequest.hasUserGesture(),
@@ -6317,7 +6322,7 @@ void RenderFrameImpl::BeginNavigation(const NavigationPolicyInfo& info) {
blink::WebURLRequest::SkipServiceWorker::None,
GetRequestContextTypeForWebURLRequest(info.urlRequest),
GetMixedContentContextTypeForWebURLRequest(info.urlRequest),
- initiator_origin);
+ is_form_submission, initiator_origin);
if (!info.form.isNull()) {
WebSearchableFormData web_searchable_form_data(info.form);

Powered by Google App Engine
This is Rietveld 408576698