summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt-pkg/contrib/proxy.cc2
-rwxr-xr-xtest/integration/test-apt-helper8
2 files changed, 8 insertions, 2 deletions
diff --git a/apt-pkg/contrib/proxy.cc b/apt-pkg/contrib/proxy.cc
index cbe640634..84d802dcb 100644
--- a/apt-pkg/contrib/proxy.cc
+++ b/apt-pkg/contrib/proxy.cc
@@ -52,7 +52,7 @@ bool AutoDetectProxy(URI &URL)
return _error->Error("ProxyAutoDetect command '%s' failed!", AutoDetectProxyCmd.c_str());
char buf[512];
if (PipeFd.ReadLine(buf, sizeof(buf)) == nullptr)
- return _error->Error("Failed to read in AutoDetectProxy");
+ return true;
PipeFd.Close();
ExecWait(Child, "ProxyAutoDetect", true);
auto const cleanedbuf = _strstrip(buf);
diff --git a/test/integration/test-apt-helper b/test/integration/test-apt-helper
index 8a25859b8..c1c193c5c 100755
--- a/test/integration/test-apt-helper
+++ b/test/integration/test-apt-helper
@@ -74,7 +74,13 @@ E: Download Failed"
test_apt_helper_detect_proxy() {
# no proxy
testsuccessequal "Using proxy '' for URL 'http://example.com/'" apthelper auto-detect-proxy http://example.com/
-
+ cat > apt-proxy-detect <<'EOF'
+#!/bin/sh -e
+exit 0
+EOF
+ chmod 755 apt-proxy-detect
+ echo "Acquire::http::Proxy-Auto-Detect \"$(pwd)/apt-proxy-detect\";" > rootdir/etc/apt/apt.conf.d/02proxy-detect
+ testsuccessequal "Using proxy '' for URL 'http://www.example.com/'" apthelper auto-detect-proxy http://www.example.com
# http auto detect proxy script
cat > apt-proxy-detect <<'EOF'