diff options
author | jschuh@google.com <jschuh@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-08 19:29:41 +0000 |
---|---|---|
committer | jschuh@google.com <jschuh@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-08 19:29:41 +0000 |
commit | 13c340e130d5fa54b3abe5f3001bda94d4569009 (patch) | |
tree | c52af4b32d11fc2be00340e867ea155648b03fbc /chrome/browser/host_content_settings_map.cc | |
parent | c3df17c94b05b3a22b6755b93dc68bcca9c010f7 (diff) | |
download | chromium_src-13c340e130d5fa54b3abe5f3001bda94d4569009.zip chromium_src-13c340e130d5fa54b3abe5f3001bda94d4569009.tar.gz chromium_src-13c340e130d5fa54b3abe5f3001bda94d4569009.tar.bz2 |
Correctly handle trailing dots in hostname blacklist.
Submitted for inferno@chromium.org
BUG=35510
TEST=HostContentSettingsMapTest.HostTrimEndingDotCheck
Review URL: http://codereview.chromium.org/669284
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40921 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/host_content_settings_map.cc')
-rw-r--r-- | chrome/browser/host_content_settings_map.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/chrome/browser/host_content_settings_map.cc b/chrome/browser/host_content_settings_map.cc index 56ac5353..811836a 100644 --- a/chrome/browser/host_content_settings_map.cc +++ b/chrome/browser/host_content_settings_map.cc @@ -12,6 +12,7 @@ #include "chrome/common/notification_type.h" #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" +#include "net/base/dns_util.h" #include "net/base/static_cookie_policy.h" // static @@ -126,7 +127,8 @@ ContentSetting HostContentSettingsMap::GetContentSetting( const std::string& host, ContentSettingsType content_type) const { AutoLock auto_lock(lock_); - HostContentSettings::const_iterator i(host_content_settings_.find(host)); + HostContentSettings::const_iterator i(host_content_settings_.find( + net::TrimEndingDot(host))); if (i != host_content_settings_.end()) { ContentSetting setting = i->second.settings[content_type]; if (setting != CONTENT_SETTING_DEFAULT) @@ -145,7 +147,8 @@ ContentSetting HostContentSettingsMap::GetContentSetting( ContentSettings HostContentSettingsMap::GetContentSettings( const std::string& host) const { AutoLock auto_lock(lock_); - HostContentSettings::const_iterator i(host_content_settings_.find(host)); + HostContentSettings::const_iterator i(host_content_settings_.find( + net::TrimEndingDot(host))); if (i == host_content_settings_.end()) return default_content_settings_; |