diff options
| author | mdm@chromium.org <mdm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-19 00:28:04 +0000 |
|---|---|---|
| committer | mdm@chromium.org <mdm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-19 00:28:04 +0000 |
| commit | aa3ac2ccbda500169fc04c56d53a91facbccf25c (patch) | |
| tree | 77760f4cfc0a59a5b75aeaaef8de51ead95243b5 | |
| parent | 6a09bf0c63fd1bcc78d6580c8b181c1064c4910d (diff) | |
| download | chromium_src-aa3ac2ccbda500169fc04c56d53a91facbccf25c.zip chromium_src-aa3ac2ccbda500169fc04c56d53a91facbccf25c.tar.gz chromium_src-aa3ac2ccbda500169fc04c56d53a91facbccf25c.tar.bz2 | |
Linux: allow proxy PAC file configurations that use just a file path without a file:// prefix. (KDE does that.)
BUG=125530
Review URL: https://chromiumcodereview.appspot.com/10580009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142874 0039d316-1c4b-4281-b951-d872f2087c98
| -rw-r--r-- | net/proxy/proxy_config_service_linux.cc | 5 | ||||
| -rw-r--r-- | net/proxy/proxy_config_service_linux_unittest.cc | 15 |
2 files changed, 19 insertions, 1 deletions
diff --git a/net/proxy/proxy_config_service_linux.cc b/net/proxy/proxy_config_service_linux.cc index fc85947..52b24e6 100644 --- a/net/proxy/proxy_config_service_linux.cc +++ b/net/proxy/proxy_config_service_linux.cc @@ -1445,11 +1445,14 @@ bool ProxyConfigServiceLinux::Delegate::GetConfigFromSettings( } if (mode == "auto") { - // automatic proxy config + // Automatic proxy config. std::string pac_url_str; if (setting_getter_->GetString(SettingGetter::PROXY_AUTOCONF_URL, &pac_url_str)) { if (!pac_url_str.empty()) { + // If the PAC URL is actually a file path, then put file:// in front. + if (pac_url_str[0] == '/') + pac_url_str = "file://" + pac_url_str; GURL pac_url(pac_url_str); if (!pac_url.is_valid()) return false; diff --git a/net/proxy/proxy_config_service_linux_unittest.cc b/net/proxy/proxy_config_service_linux_unittest.cc index 2b836e0..a0534c8 100644 --- a/net/proxy/proxy_config_service_linux_unittest.cc +++ b/net/proxy/proxy_config_service_linux_unittest.cc @@ -1098,6 +1098,21 @@ TEST_F(ProxyConfigServiceLinuxTest, KDEConfigParser) { }, { + TEST_DESC("Valid PAC file without file://"), + + // Input. + "[Proxy Settings]\nProxyType=2\n" + "Proxy Config Script=/wpad/wpad.dat\n", + {}, // env_values + + // Expected result. + ProxyConfigService::CONFIG_VALID, + false, // auto_detect + GURL("file:///wpad/wpad.dat"), // pac_url + ProxyRulesExpectation::Empty(), + }, + + { TEST_DESC("Per-scheme proxy rules"), // Input. |
