protocol: catch wrong URLs ending with bare colon

exec
dece 3 years ago
parent ff49f0d17e
commit 9f5cae5014

@ -65,7 +65,11 @@ class Request:
hostname = url_parts["host"]
if ":" in hostname:
hostname, port = hostname.split(":", maxsplit=1)
port = int(port)
try:
port = int(port)
except ValueError:
self.state = Request.STATE_INVALID_URL
return False
else:
port = 1965

Loading…
Cancel
Save