diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-27 21:06:11 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-27 21:06:11 +0000 |
commit | 833fa265a5239fca9c675fb029cd2ef53b5c5aa7 (patch) | |
tree | 807d05a9aa7f87b72b38f7d0a9328297e85d9500 /net/base/net_util.h | |
parent | e33972ead0b1acd54d1614ba794e5db2152527ba (diff) | |
download | chromium_src-833fa265a5239fca9c675fb029cd2ef53b5c5aa7.zip chromium_src-833fa265a5239fca9c675fb029cd2ef53b5c5aa7.tar.gz chromium_src-833fa265a5239fca9c675fb029cd2ef53b5c5aa7.tar.bz2 |
Loosen RFC 1738 compliance check to allow underscores where we already allowed hyphens, to match real-world needs.
I don't believe further loosening will be required but that data will hopefully be coming soon. In the meantime people are asking for this fix.
BUG=25714
TEST=Entring "a_b.com" in the omnibox should default to navigate, not search
Review URL: http://codereview.chromium.org/339017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30245 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/net_util.h')
-rw-r--r-- | net/base/net_util.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/net/base/net_util.h b/net/base/net_util.h index 1ad4ac2..0d78598 100644 --- a/net/base/net_util.h +++ b/net/base/net_util.h @@ -158,16 +158,17 @@ std::string CanonicalizeHost(const std::string& host, std::string CanonicalizeHost(const std::wstring& host, url_canon::CanonHostInfo* host_info); -// Returns true if |host| is RFC 1738-compliant (and not an IP address). The -// rules are: +// Returns true if |host| is not an IP address and is compliant with a set of +// rules based on RFC 1738 and tweaked to be compatible with the real world. +// The rules are: // * One or more components separated by '.' // * Each component begins and ends with an alphanumeric character -// * Each component contains only alphanumeric characters and '-' +// * Each component contains only alphanumeric characters and '-' or '_' // * The last component does not begin with a digit // // NOTE: You should only pass in hosts that have been returned from // CanonicalizeHost(), or you may not get accurate results. -bool IsCanonicalizedHostRFC1738Compliant(const std::string& host); +bool IsCanonicalizedHostCompliant(const std::string& host); // Call these functions to get the html snippet for a directory listing. // The return values of both functions are in UTF-8. |