mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 08:11:00 +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):
|
def new_request(self, url, method):
|
||||||
|
try:
|
||||||
parts = mitmproxy.net.http.url.parse(str(url))
|
parts = mitmproxy.net.http.url.parse(str(url))
|
||||||
if not parts:
|
except ValueError as e:
|
||||||
signals.status_message.send(message="Invalid Url")
|
signals.status_message.send(message = "Invalid URL: " + str(e))
|
||||||
return
|
return
|
||||||
scheme, host, port, path = parts
|
scheme, host, port, path = parts
|
||||||
f = self.master.create_request(method, scheme, host, port, path)
|
f = self.master.create_request(method, scheme, host, port, path)
|
||||||
|
Loading…
Reference in New Issue
Block a user