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

Unified Diff: net/url_request/url_request_http_job.cc

Issue 11192045: Process only the first Strict-Transport-Security header. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Disable the tests in CF. Created 8 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 | « net/http/http_util.cc ('k') | net/url_request/url_request_test_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_http_job.cc
===================================================================
--- net/url_request/url_request_http_job.cc (revision 164933)
+++ net/url_request/url_request_http_job.cc (working copy)
@@ -701,7 +701,16 @@
void* iter = NULL;
base::Time now = base::Time::Now();
+ // http://tools.ietf.org/html/draft-ietf-websec-strict-transport-sec:
+ //
+ // If a UA receives more than one STS header field in a HTTP response
+ // message over secure transport, then the UA MUST process only the
+ // first such header field.
+ bool seen_sts = false;
while (headers->EnumerateHeader(&iter, "Strict-Transport-Security", &value)) {
+ if (seen_sts)
+ return;
+ seen_sts = true;
TransportSecurityState::DomainState domain_state;
if (domain_state.ParseSTSHeader(now, value))
security_state->EnableHost(host, domain_state);
« no previous file with comments | « net/http/http_util.cc ('k') | net/url_request/url_request_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698