Merge pull request #1921 from rllola/tracker-announcer
If no port defined in tracker url assume it is port 80
This commit is contained in:
commit
116347ef66
1 changed files with 7 additions and 1 deletions
|
@ -172,7 +172,13 @@ class SiteAnnouncer(object):
|
|||
if "://" not in tracker or not re.match("^[A-Za-z0-9:/\\.#-]+$", tracker):
|
||||
return None
|
||||
protocol, address = tracker.split("://", 1)
|
||||
ip, port = address.rsplit(":", 1)
|
||||
try:
|
||||
ip, port = address.rsplit(":", 1)
|
||||
except ValueError as err:
|
||||
ip = address
|
||||
port = 80
|
||||
if protocol.startswith("https"):
|
||||
port = 443
|
||||
back = {}
|
||||
back["protocol"] = protocol
|
||||
back["address"] = address
|
||||
|
|
Loading…
Reference in a new issue