mirror of https://gitlab.com/bashrc2/epicyon
Handle invalid ports
parent
7758253215
commit
5e1e5f8961
5
utils.py
5
utils.py
|
@ -188,7 +188,10 @@ def getDomainFromActor(actor: str) -> (str,int):
|
||||||
else:
|
else:
|
||||||
domain = actor.split('/users/')[0].replace('https://','').replace('http://','').replace('i2p://','').replace('dat://','')
|
domain = actor.split('/users/')[0].replace('https://','').replace('http://','').replace('i2p://','').replace('dat://','')
|
||||||
if ':' in domain:
|
if ':' in domain:
|
||||||
port=int(domain.split(':')[1])
|
portStr=domain.split(':')[1]
|
||||||
|
if not portStr.isdigit():
|
||||||
|
return None,None
|
||||||
|
port=int(portStr)
|
||||||
domain=domain.split(':')[0]
|
domain=domain.split(':')[0]
|
||||||
return domain,port
|
return domain,port
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue