summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSelim Gurun <sgurun@google.com>2014-12-15 09:46:43 -0800
committerSelim Gurun <sgurun@google.com>2014-12-15 09:46:43 -0800
commit2705cc61d945662005e7001290cd0572ed2e8a0e (patch)
tree7ea3af9394f836fbe42164c34f3d8ef64aadfbca
parentc64ad5c2e063cde757eba7f9499a8e748b57cbdc (diff)
downloadchromium_org-2705cc61d945662005e7001290cd0572ed2e8a0e.tar.gz
do not send traffic to localhost through proxy for android
Bug: 18736075 Cherry-pick https://codereview.chromium.org/796003002/. Clean cherry-pick. The proxy config service for android does not allow one to configure an exception for localhost be made. The implementation for Linux did allow this in: proxy_config_service_linux.cc it just seems it was overlooked for android. Instead of adding in the ability to configure localhost as an exclusion, it makes more sense to just force the exception; it seems silly to send traffic for localhost through a proxy. This patch addresses the following bug in android: https://code.google.com/p/android/issues/detail?id=37031 Change-Id: I3b654d45e9f534961cae9147374023ef597aa927
-rw-r--r--net/proxy/proxy_config_service_android.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/proxy/proxy_config_service_android.cc b/net/proxy/proxy_config_service_android.cc
index 3771a584c0..32027660bd 100644
--- a/net/proxy/proxy_config_service_android.cc
+++ b/net/proxy/proxy_config_service_android.cc
@@ -98,6 +98,12 @@ void AddBypassRules(const std::string& scheme,
// by | and that use * as a wildcard. For example, setting the
// http.nonProxyHosts property to *.android.com|*.kernel.org will cause
// requests to http://developer.android.com to be made without a proxy.
+
+ // Force localhost to be on the proxy exclusion list;
+ // otherwise all localhost traffic is routed through
+ // the proxy which is not desired.
+ bypass_rules->AddRuleToBypassLocal();
+
std::string non_proxy_hosts =
get_property.Run(scheme + ".nonProxyHosts");
if (non_proxy_hosts.empty())