IPv6: accept IPv6 address and port in hostname

This commit is contained in:
Alberto Sottile 2018-11-08 15:13:29 +01:00
parent 68a05cb021
commit 21d4604578

View File

@ -313,7 +313,9 @@ class ConfigurationGetter(object):
port = constants.DEFAULT_PORT if not self._config["port"] else self._config["port"]
if host:
if ':' in host:
host, port = host.split(':', 1)
host, port = host.rsplit(':', 1)
if '[' in host:
host = host.strip('[]')
try:
port = int(port)
except ValueError: