Commit 4b90c206 authored by mdm@chromium.org's avatar mdm@chromium.org

Linux: Add support for new KDE space-delimited proxy port numbers.

BUG=123288

Review URL: http://codereview.chromium.org/10217008

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@133802 0039d316-1c4b-4281-b951-d872f2087c98
parent 256d2732
......@@ -1099,10 +1099,19 @@ class SettingGetterImplKDE : public ProxyConfigServiceLinux::SettingGetter,
if (value.empty() || value.substr(0, 3) == "//:")
// No proxy.
return;
// We don't need to parse the port number out; GetProxyFromSettings()
// would only append it right back again. So we just leave the port
// number right in the host string.
string_table_[host_key] = value;
size_t space = value.find(' ');
if (space != std::string::npos) {
// Newer versions of KDE use a space rather than a colon to separate the
// port number from the hostname. If we find this, we need to convert it.
std::string fixed = value;
fixed[space] = ':';
string_table_[host_key] = fixed;
} else {
// We don't need to parse the port number out; GetProxyFromSettings()
// would only append it right back again. So we just leave the port
// number right in the host string.
string_table_[host_key] = value;
}
}
void AddHostList(StringListSetting key, const std::string& value) {
......
......@@ -1154,6 +1154,25 @@ TEST_F(ProxyConfigServiceLinuxTest, KDEConfigParser) {
""), // bypass rules
},
{
TEST_DESC("Only HTTP proxy specified, different port, space-delimited"),
// Input.
"[Proxy Settings]\nProxyType=1\n"
"httpProxy=www.google.com 88\n",
{}, // env_values
// Expected result.
ProxyConfigService::CONFIG_VALID,
false, // auto_detect
GURL(), // pac_url
ProxyRulesExpectation::PerScheme(
"www.google.com:88", // http
"", // https
"", // ftp
""), // bypass rules
},
{
TEST_DESC("Bypass *.google.com"),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment