# Fix 410 Issue Correcte syntax write for connect server (#411)

This commit is contained in:
vBlackOut 2020-03-28 07:44:28 +01:00 committed by GitHub
parent 9e78abd2c2
commit 580462156e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -64,6 +64,11 @@ def parse_hostport(rhostport):
# default define variable
port = ""
username = re.split(r'\s*:', rhostport)[0]
# Fix #410 bad username error detect
if "@" in username:
username = re.split(r'\s*@', rhostport)[0]
password = None
host = None
@ -82,9 +87,12 @@ def parse_hostport(rhostport):
if host is None:
# split for ipv4 or ipv6
host = "{}".format(re.split(r'\s*@', rhostport)[1])
# try if port define
try:
port = re.split(r'\s*:', rhostport)[2].split('@')[0]
# Fix #410 detect host:port
port = re.split(r'\s*:', host)[1]
host = re.split(r'\s*:', host)[0]
except IndexError:
pass