Fix extract_host_port port separation

Regex quantifier should be lazy to make port separation work.
This commit is contained in:
cbachert
2020-10-24 00:25:53 +01:00
parent 966383c762
commit 72a9ec5b7c
2 changed files with 2 additions and 2 deletions

View File

@@ -84,7 +84,7 @@ def get_status(protocol, status):
return status, codes[protocol]
def extract_host_port(host_and_port, default_port):
host, _, port = re.match('^(.*)(:([0-9]*))?$', host_and_port).groups()
host, _, port = re.match('^(.*?)(:([0-9]*))?$', host_and_port).groups()
return host, int(port) if port else default_port
def get_server(protocol, authenticated=False):