From 55e471af407c5ee9dfb0292e45f4d9586e9fd524 Mon Sep 17 00:00:00 2001 From: lymanZerga11 Date: Sun, 12 Feb 2017 23:06:11 +0800 Subject: [PATCH] Catch ValueErrors from url.parse() --- mitmproxy/tools/console/flowlist.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mitmproxy/tools/console/flowlist.py b/mitmproxy/tools/console/flowlist.py index 39811ce10..83ad63f3d 100644 --- a/mitmproxy/tools/console/flowlist.py +++ b/mitmproxy/tools/console/flowlist.py @@ -338,9 +338,10 @@ class FlowListBox(urwid.ListBox): ) def new_request(self, url, method): - parts = mitmproxy.net.http.url.parse(str(url)) - if not parts: - signals.status_message.send(message="Invalid Url") + try: + parts = mitmproxy.net.http.url.parse(str(url)) + except ValueError as e: + signals.status_message.send(message = "Invalid URL: " + str(e)) return scheme, host, port, path = parts f = self.master.create_request(method, scheme, host, port, path)