Allow override of Proxy-Auto-Detect by the users configuration
authorMichael Vogt <mvo@ubuntu.com>
Fri, 12 Sep 2014 09:44:11 +0000 (11:44 +0200)
committerMichael Vogt <mvo@ubuntu.com>
Fri, 12 Sep 2014 09:44:11 +0000 (11:44 +0200)
Only run the Proxy-Auto-Detect code if there is not already
a host specific configuration.

Closes: 759264

apt-pkg/contrib/proxy.cc

index b58db84..0c75313 100644 (file)
@@ -26,6 +26,10 @@ bool AutoDetectProxy(URI &URL)
    // we support both http/https debug options
    bool Debug = _config->FindB("Debug::Acquire::"+URL.Access,false);
 
+   // the user already explicitly set a proxy for this host
+   if(_config->Find("Acquire::"+URL.Access+"::proxy::"+URL.Host, "") != "")
+      return true;
+
    // option is "Acquire::http::Proxy-Auto-Detect" but we allow the old
    // name without the dash ("-")
    std::string AutoDetectProxyCmd = _config->Find("Acquire::"+URL.Access+"::Proxy-Auto-Detect",