added check for port so that invalid port numbers gets rejected
@@ -585,6 +585,6 @@ def isValidEndpoint(endpoint):
ip, port = endpoint.split(':')
try:
ipaddress.ip_address(ip)
- return port.isdigit()
+ return port.isdigit() and int(port) in range(1, 65535)
except Exception:
return False
\ No newline at end of file
