[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ipfire-development
Subject:    [PATCH 2/2] fix download routines in Pakfire if behind upstream proxy
From:       Peter Müller <peter.mueller () link38 ! eu>
Date:       2018-10-22 17:58:13
Message-ID: 20181022175813.3938-2-peter.mueller () link38 ! eu
[Download RAW message or body]

Using an array for setting both HTTP and HTTPS proxy settings in
functions.pl does not seem to work, the queries are still transferred
directly.

Setting proxies with two code lines is boilerplate-style, but
works much more robust.

Partially fixes #11900

Signed-off-by: Peter Müller <peter.mueller@link38.eu>
---
 src/pakfire/lib/functions.pl | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/pakfire/lib/functions.pl b/src/pakfire/lib/functions.pl
index bbc580ad2..291a111b9 100644
--- a/src/pakfire/lib/functions.pl
+++ b/src/pakfire/lib/functions.pl
@@ -157,10 +157,12 @@ sub fetchfile {
 		if ($proxysettings{'UPSTREAM_PROXY'}) {
 			logger("DOWNLOAD INFO: Upstream proxy: \"$proxysettings{'UPSTREAM_PROXY'}\"");
 			if ($proxysettings{'UPSTREAM_USER'}) {
-				$ua->proxy([["http", "https"] => \
"http://$proxysettings{'UPSTREAM_USER'}:$proxysettings{'UPSTREAM_PASSWORD'}@"."$proxysettings{'UPSTREAM_PROXY'}/"]);
 +				$ua->proxy("http" => \
"http://$proxysettings{'UPSTREAM_USER'}:$proxysettings{'UPSTREAM_PASSWORD'}\@$proxysettings{'UPSTREAM_PROXY'}/");
 +				$ua->proxy("https" => \
"http://$proxysettings{'UPSTREAM_USER'}:$proxysettings{'UPSTREAM_PASSWORD'}\@$proxysettings{'UPSTREAM_PROXY'}/");
                
 				logger("DOWNLOAD INFO: Logging in with: \"$proxysettings{'UPSTREAM_USER'}\" - \
\"$proxysettings{'UPSTREAM_PASSWORD'}\"");  } else {
-				$ua->proxy([["http", "https"] => "http://$proxysettings{'UPSTREAM_PROXY'}/"]);
+				$ua->proxy("http" => "http://$proxysettings{'UPSTREAM_PROXY'}/");
+				$ua->proxy("https" => "http://$proxysettings{'UPSTREAM_PROXY'}/");
 			}
 		}
 
-- 
2.16.4


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic