mirror of
https://github.com/Mailu/Mailu.git
synced 2025-02-21 19:19:39 +02:00
Fix extract_host_port port separation
Regex quantifier should be lazy to make port separation work.
This commit is contained in:
parent
966383c762
commit
72a9ec5b7c
@ -84,7 +84,7 @@ def get_status(protocol, status):
|
|||||||
return status, codes[protocol]
|
return status, codes[protocol]
|
||||||
|
|
||||||
def extract_host_port(host_and_port, default_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
|
return host, int(port) if port else default_port
|
||||||
|
|
||||||
def get_server(protocol, authenticated=False):
|
def get_server(protocol, authenticated=False):
|
||||||
|
@ -28,7 +28,7 @@ poll "{host}" proto {protocol} port {port}
|
|||||||
|
|
||||||
|
|
||||||
def extract_host_port(host_and_port, default_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
|
return host, int(port) if port else default_port
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user