mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 00:01:36 +00:00
Catch ValueErrors from url.parse()
This commit is contained in:
parent
f77cf03543
commit
55e471af40
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user