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

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

Issue 2462513003: PlzNavigate: Add missing Upgrade-Insecure-Requests header. (Closed)
Patch Set: PlzNavigate:Add missing Upgrade-Insecure-Requests header. Created 4 years, 2 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/security/upgrade-insecure-requests/https-header-top-level-browser-initiated.php » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/navigation_request.cc
diff --git a/content/browser/frame_host/navigation_request.cc b/content/browser/frame_host/navigation_request.cc
index ddbc83136f8991d8655256ef4630aaa3bf83e05c..23eccb1b27444f3a1ad937f5670299cd5d386b84 100644
--- a/content/browser/frame_host/navigation_request.cc
+++ b/content/browser/frame_host/navigation_request.cc
@@ -126,6 +126,11 @@ void AddAdditionalRequestHeaders(net::HttpRequestHeaders* headers,
headers->SetHeaderIfMissing(net::HttpRequestHeaders::kUserAgent,
GetContentClient()->GetUserAgent());
+
+ // Tack an 'Upgrade-Insecure-Requests' header to outgoing navigational
clamy 2016/11/02 14:01:30 This is called also for subframe navigations, is t
arthursonzogni 2016/11/02 16:55:28 Yes it is. The browser-side implementation is putt
+ // requests, as described in
+ // https://w3c.github.io/webappsec/specs/upgrade/#feature-detect
+ headers->AddHeaderFromString("Upgrade-Insecure-Requests: 1");
}
} // namespace
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/security/upgrade-insecure-requests/https-header-top-level-browser-initiated.php » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698