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

Unified Diff: net/url_request/url_request_http_job.cc

Issue 193067: Strict transport security: come out from behind the flag. (Closed)
Patch Set: Created 11 years, 3 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 | « base/base_switches.cc ('k') | no next file » | 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
diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc
index ada4ad1cb0e132987140133a3fb52625b477b1d6..8d71b362514499f0d403b5772fd9783b662736b3 100644
--- a/net/url_request/url_request_http_job.cc
+++ b/net/url_request/url_request_http_job.cc
@@ -46,11 +46,7 @@ URLRequestJob* URLRequestHttpJob::Factory(URLRequest* request,
return new URLRequestErrorJob(request, net::ERR_INVALID_ARGUMENT);
}
- // We cache the value of the switch because this code path is hit on every
- // network request.
- static const bool kForceHTTPS =
- CommandLine::ForCurrentProcess()->HasSwitch(switches::kForceHTTPS);
- if (kForceHTTPS && scheme == "http" &&
+ if (scheme == "http" &&
request->context()->strict_transport_security_state() &&
request->context()->strict_transport_security_state()->IsEnabledForHost(
request->url().host())) {
abarth-chromium 2009/09/10 00:59:02 I'm slightly worried about the performance implica
@@ -486,10 +482,6 @@ bool URLRequestHttpJob::ShouldTreatAsCertificateError(int result) {
if (!net::IsCertificateError(result))
return false;
- // Hide the fancy processing behind a command line switch.
- if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kForceHTTPS))
- return true;
-
// Check whether our context is using Strict-Transport-Security.
if (!context_->strict_transport_security_state())
return true;
@@ -698,10 +690,6 @@ void URLRequestHttpJob::FetchResponseCookies() {
void URLRequestHttpJob::ProcessStrictTransportSecurityHeader() {
DCHECK(response_info_);
- // Hide processing behind a command line flag.
- if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kForceHTTPS))
- return;
-
// Only process Strict-Transport-Security from HTTPS responses.
if (request_info_.url.scheme() != "https")
return;
« no previous file with comments | « base/base_switches.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698