Strip "+" from the start of port after checking if it is present

This commit is contained in:
jesopo 2019-05-21 10:42:40 +01:00
parent 1daa4217ec
commit 9124f84e25

View file

@ -111,6 +111,7 @@ class Module(ModuleManager.BaseModule):
alias = event["args_split"][0] alias = event["args_split"][0]
hostname, sep, port = event["args_split"][1].partition(":") hostname, sep, port = event["args_split"][1].partition(":")
tls = port.startswith("+") tls = port.startswith("+")
port = port.lstrip("+")
if not hostname or not port or not port.isdigit(): if not hostname or not port or not port.isdigit():
raise utils.EventError("Please provide <hostname>:[+]<port>") raise utils.EventError("Please provide <hostname>:[+]<port>")