Commit 8281073e authored by rgaudin's avatar rgaudin
Browse files

Fixed display of proxy config if settings could not be parsed

parent f4f293bd
......@@ -546,11 +546,17 @@ def split_proxy(proxy_url):
try:
url = urlparse(proxy_url)
if url.port:
return url.netloc[: -(len(str(url.port)) + 1)], str(url.port)
return url.netloc, ""
netloc = url.netloc[: -(len(str(url.port)) + 1)] # remove port from netloc
port = str(url.port)
else:
netloc = url.netloc
port = ""
except Exception:
# could not parse URL, attempt something
parts = proxy_url.rsplit(":", 1)
return parts[0], parts[1] if len(parts) > 1 else ""
netloc = parts[0].split("://", 1)[-1]
port = parts[1] if len(parts) > 1 else ""
return netloc, port
def get_prefs_path():
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment