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

Unified Diff: components/google/core/browser/google_url_tracker.cc

Issue 263023002: Force usage of HTTPS for Google services. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add test Created 5 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
« no previous file with comments | « no previous file | components/google/core/browser/google_url_tracker_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/google/core/browser/google_url_tracker.cc
diff --git a/components/google/core/browser/google_url_tracker.cc b/components/google/core/browser/google_url_tracker.cc
index 444883410cccef5a3dfa17bd38259578573df30a..dd72e359e8a770e0797913b8248959a885f8f02c 100644
--- a/components/google/core/browser/google_url_tracker.cc
+++ b/components/google/core/browser/google_url_tracker.cc
@@ -17,9 +17,9 @@
const char GoogleURLTracker::kDefaultGoogleHomepage[] =
- "http://www.google.com/";
+ "https://www.google.com/";
const char GoogleURLTracker::kSearchDomainCheckURL[] =
- "https://www.google.com/searchdomaincheck?format=url&type=chrome";
+ "https://www.google.com/searchdomaincheck?format=domain&type=chrome";
GoogleURLTracker::GoogleURLTracker(scoped_ptr<GoogleURLTrackerClient> client,
Mode mode)
@@ -81,16 +81,16 @@ void GoogleURLTracker::OnURLFetchComplete(const net::URLFetcher* source) {
return;
}
- // See if the response data was valid. It should be
- // "<scheme>://[www.]google.<TLD>/".
+ // See if the response data was valid. It should be ".google.<TLD>".
std::string url_str;
source->GetResponseAsString(&url_str);
base::TrimWhitespace(url_str, base::TRIM_ALL, &url_str);
- GURL url(url_str);
+ if (!StartsWithASCII(url_str, ".google.", false))
+ return;
+ GURL url("https://www" + url_str);
if (!url.is_valid() || (url.path().length() > 1) || url.has_query() ||
url.has_ref() ||
- !google_util::IsGoogleDomainUrl(url,
- google_util::DISALLOW_SUBDOMAIN,
+ !google_util::IsGoogleDomainUrl(url, google_util::DISALLOW_SUBDOMAIN,
google_util::DISALLOW_NON_STANDARD_PORTS))
return;
« no previous file with comments | « no previous file | components/google/core/browser/google_url_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698