diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-05 15:48:06 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-05 15:48:06 +0000 |
commit | fb2ab08257345bff2d48e74f1d5e96faf2f8b493 (patch) | |
tree | a400ca4cffdb09e19c62489848226c7740819c3a | |
parent | a4adab68d36edfecd5c27bc06084b305a5ea6200 (diff) | |
download | chromium_src-fb2ab08257345bff2d48e74f1d5e96faf2f8b493.zip chromium_src-fb2ab08257345bff2d48e74f1d5e96faf2f8b493.tar.gz chromium_src-fb2ab08257345bff2d48e74f1d5e96faf2f8b493.tar.bz2 |
Pull latest googleurl to get it to stop unescaping at signs in paths.
This also fixes the URL displayer to stop unescaping at signs. Otherwise, we'll have the weird situation where if you go to a site with a %40 in it where it cares about the difference between %40 and @, pressing enter in the URL bar will load the "@" variant and the URL won't load.
BUG=http:///crbug.com/23933
TEST=included unit test
Review URL: http://codereview.chromium.org/1614001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43615 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | DEPS | 2 | ||||
-rw-r--r-- | net/base/escape.cc | 2 | ||||
-rw-r--r-- | net/base/escape_unittest.cc | 4 | ||||
-rw-r--r-- | net/base/net_util.cc | 3 | ||||
-rw-r--r-- | net/base/net_util_unittest.cc | 5 |
5 files changed, 13 insertions, 3 deletions
@@ -17,7 +17,7 @@ deps = { "/trunk/deps/support@20411", "src/googleurl": - "http://google-url.googlecode.com/svn/trunk@125", + "http://google-url.googlecode.com/svn/trunk@127", "src/sdch/open-vcdiff": "http://open-vcdiff.googlecode.com/svn/trunk@28", diff --git a/net/base/escape.cc b/net/base/escape.cc index bf23bcb..bc01e11 100644 --- a/net/base/escape.cc +++ b/net/base/escape.cc @@ -99,7 +99,7 @@ const char kUrlUnescape[128] = { // 0 1 2 3 4 5 6 7 8 9 : ; < = > ? 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, // @ A B C D E F G H I J K L M N O - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // P Q R S T U V W X Y Z [ \ ] ^ _ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // ` a b c d e f g h i j k l m n o diff --git a/net/base/escape_unittest.cc b/net/base/escape_unittest.cc index 1869058..28972cb 100644 --- a/net/base/escape_unittest.cc +++ b/net/base/escape_unittest.cc @@ -238,6 +238,10 @@ TEST(EscapeTest, UnescapeURLComponent) { {L"Hello%20%13%10world %23# %3F? %3D= %26& %25% %2B+", UnescapeRule::URL_SPECIAL_CHARS, L"Hello%20%13%10world ## ?? == && %% ++"}, + // We can neither escape nor unescape '@' since some websites expect it to + // be preserved as either '@' or "%40". + // See http://b/996720 and http://crbug.com/23933 . + {L"me@my%40example", UnescapeRule::NORMAL, L"me@my%40example"}, // Control characters. {L"%01%02%03%04%05%06%07%08%09 %25", UnescapeRule::URL_SPECIAL_CHARS, L"%01%02%03%04%05%06%07%08%09 %"}, diff --git a/net/base/net_util.cc b/net/base/net_util.cc index aa2cb1b..b78b525 100644 --- a/net/base/net_util.cc +++ b/net/base/net_util.cc @@ -1278,7 +1278,8 @@ std::string GetHostName() { void GetIdentityFromURL(const GURL& url, std::wstring* username, std::wstring* password) { - UnescapeRule::Type flags = UnescapeRule::SPACES; + UnescapeRule::Type flags = + UnescapeRule::SPACES | UnescapeRule::URL_SPECIAL_CHARS; *username = UTF16ToWideHack(UnescapeAndDecodeUTF8URLComponent(url.username(), flags, NULL)); *password = UTF16ToWideHack(UnescapeAndDecodeUTF8URLComponent(url.password(), diff --git a/net/base/net_util_unittest.cc b/net/base/net_util_unittest.cc index 09573b1..833375c 100644 --- a/net/base/net_util_unittest.cc +++ b/net/base/net_util_unittest.cc @@ -554,6 +554,11 @@ TEST(NetUtilTest, GetIdentityFromURL) { L"username", L"p@ssword", }, + { // Special URL characters should be unescaped. + "http://username:p%3fa%26s%2fs%23@google.com", + L"username", + L"p?a&s/s#", + }, { // Username contains %20. "http://use rname:password@google.com", L"use rname", |