From 9f5cae50143ecece16ab3ef886dd31a65b911a1a Mon Sep 17 00:00:00 2001 From: dece Date: Fri, 26 Feb 2021 15:36:02 +0100 Subject: [PATCH] protocol: catch wrong URLs ending with bare colon --- bebop/protocol.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bebop/protocol.py b/bebop/protocol.py index b3a02e2..33356ec 100644 --- a/bebop/protocol.py +++ b/bebop/protocol.py @@ -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