1
0
mirror of https://github.com/Mailu/Mailu.git synced 2025-02-19 19:10:25 +02:00

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):

View File

@ -28,7 +28,7 @@ poll "{host}" proto {protocol} port {port}
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