diff options
author | lymanZerga11 <lymanZerga11@users.noreply.github.com> | 2017-02-12 23:06:11 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-12 23:06:11 +0800 |
commit | 55e471af407c5ee9dfb0292e45f4d9586e9fd524 (patch) | |
tree | 592d499e5daf2e932b11fb5d76075fd928d77a17 | |
parent | f77cf03543d89a9503cd86fb48fe4d9d32b57190 (diff) | |
download | mitmproxy-55e471af407c5ee9dfb0292e45f4d9586e9fd524.tar.gz mitmproxy-55e471af407c5ee9dfb0292e45f4d9586e9fd524.tar.bz2 mitmproxy-55e471af407c5ee9dfb0292e45f4d9586e9fd524.zip |
Catch ValueErrors from url.parse()
-rw-r--r-- | mitmproxy/tools/console/flowlist.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/mitmproxy/tools/console/flowlist.py b/mitmproxy/tools/console/flowlist.py index 39811ce1..83ad63f3 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) |