fix tr连接失败

This commit is contained in:
thsrite
2023-08-12 15:42:37 +08:00
parent ff5b420005
commit 0a84a50a19
3 changed files with 4 additions and 6 deletions

View File

@ -543,13 +543,13 @@ class StringUtils:
return reparse
@staticmethod
def get_domain_address(address: str) -> Tuple[Optional[str], Optional[int]]:
def get_domain_address(address: str, prefix: bool = True) -> Tuple[Optional[str], Optional[int]]:
"""
从地址中获取域名和端口号
"""
if not address:
return None, None
if not address.startswith("http"):
if prefix and not address.startswith("http"):
address = "http://" + address
parts = address.split(":")
if len(parts) > 3: