Remove [] characters from IPv6 hosts when splitting to host and port (#2309)

Close #2269
This commit is contained in:
Alexander Kukushkin
2022-05-20 10:24:25 +02:00
committed by GitHub
parent 729f1dddc8
commit 4c14b302f6
+1 -1
View File
@@ -362,7 +362,7 @@ def polling_loop(timeout, interval=1):
def split_host_port(value, default_port):
t = value.rsplit(':', 1)
if ':' in t[0]:
t[0] = t[0].strip('[]')
t[0] = ','.join([h.strip().strip('[]') for h in t[0].split(',')])
t.append(default_port)
return t[0], int(t[1])