diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-10 06:36:34 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-10 06:36:34 +0000 |
commit | 83c7264800194b0d9ffdce49c57a3fdd5cf6a1a0 (patch) | |
tree | 11179533d5a0550b63b4a7a6ba9361f0dc9698da /chrome/browser/autocomplete/autocomplete.cc | |
parent | fcfaa4e7e70d366db6accae092855f59c44be4a9 (diff) | |
download | chromium_src-83c7264800194b0d9ffdce49c57a3fdd5cf6a1a0.zip chromium_src-83c7264800194b0d9ffdce49c57a3fdd5cf6a1a0.tar.gz chromium_src-83c7264800194b0d9ffdce49c57a3fdd5cf6a1a0.tar.bz2 |
Don't send queries when URL is like:
- starts with http:// or https:// and includes username (e.g.
http://me@test.com/)
- starts with http:// or https:// and includes query (e.g. http://test.com/?q=x)
- starts with https:// and includes path component (e.g. https://test.com/path)
so as not to leak user data to the suggest server.
Patch by takayoshi.kochi@gmail.com
BUG=1647
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1978 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete/autocomplete.cc')
-rw-r--r-- | chrome/browser/autocomplete/autocomplete.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/chrome/browser/autocomplete/autocomplete.cc b/chrome/browser/autocomplete/autocomplete.cc index 6e7dc97..42b6d81 100644 --- a/chrome/browser/autocomplete/autocomplete.cc +++ b/chrome/browser/autocomplete/autocomplete.cc @@ -39,8 +39,7 @@ AutocompleteInput::AutocompleteInput(const std::wstring& text, if (TrimWhitespace(text, TRIM_ALL, &text_) & TRIM_TRAILING) prevent_inline_autocomplete_ = true; - url_parse::Parsed parts; - type_ = Parse(text_, desired_tld, &parts, &scheme_); + type_ = Parse(text_, desired_tld, &parts_, &scheme_); if (type_ == INVALID) return; @@ -220,6 +219,7 @@ bool AutocompleteInput::Equals(const AutocompleteInput& other) const { void AutocompleteInput::Clear() { text_.clear(); type_ = INVALID; + parts_ = url_parse::Parsed(); scheme_.clear(); desired_tld_.clear(); prevent_inline_autocomplete_ = false; @@ -743,4 +743,3 @@ void AutocompleteController::AddHistoryContentsShortcut( match.provider = history_contents_provider_; result->AddMatch(match); } - |