Catch ValueErrors from url.parse()

This commit is contained in:
lymanZerga11 2017-02-12 23:06:11 +08:00 committed by GitHub
parent f77cf03543
commit 55e471af40

View File

@ -338,9 +338,10 @@ class FlowListBox(urwid.ListBox):
)
def new_request(self, url, method):
try:
parts = mitmproxy.net.http.url.parse(str(url))
if not parts:
signals.status_message.send(message="Invalid 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)