From dde5ee3701faeb324d4d9c973409711eae27f32e Mon Sep 17 00:00:00 2001 From: Alexey Minnekhanov Date: Thu, 23 Aug 2018 11:15:33 +0300 Subject: [PATCH] Fix parsing system proxy var containing "user:password@" part --- service/settings.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/service/settings.py b/service/settings.py index 75bdb5405..39f8def9c 100644 --- a/service/settings.py +++ b/service/settings.py @@ -248,6 +248,11 @@ class NetworkSettings(object): proto = "{0}://".format(prefix) if proxyline[:len(proto)] == proto: proxyline = proxyline[len(proto):] + # sometimes proxyline contains "user:password@" section before proxy address + # remove it if present, so later split by ":" works + if '@' in proxyline: + userPass, proxyline = proxyline.split("@") + # TODO: do something with user/password? proxAddr, proxPort = proxyline.split(":") proxPort = int(proxPort.rstrip("/")) proxy = (proxAddr, proxPort)