mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 08:11:00 +00:00
added support for 'b' key in flowlist
This commit is contained in:
parent
d80e2e2b2b
commit
e5922ae30a
@ -189,8 +189,36 @@ def ask_save_body(k, master, state, content):
|
||||
content,
|
||||
)
|
||||
|
||||
def which_body_save(k, master, state, flow):
|
||||
if k == "q":
|
||||
master.path_prompt(
|
||||
"Save request content: ",
|
||||
state.last_saveload,
|
||||
save_body,
|
||||
master,
|
||||
state,
|
||||
flow.request.get_decoded_content(),
|
||||
)
|
||||
elif k == "r":
|
||||
if flow.response:
|
||||
master.path_prompt(
|
||||
"Save response content: ",
|
||||
state.last_saveload,
|
||||
save_body,
|
||||
master,
|
||||
state,
|
||||
flow.response.get_decoded_content(),
|
||||
)
|
||||
else:
|
||||
master.statusbar.message("Flow has no response")
|
||||
|
||||
## common copy_message parts
|
||||
def copy_message( k, master, state, message):
|
||||
if not message:
|
||||
# only response could be None
|
||||
master.statusbar.message("Flow has no response")
|
||||
return
|
||||
|
||||
if pyperclip:
|
||||
if k == "c":
|
||||
try:
|
||||
|
@ -7,6 +7,7 @@ def _mkhelp():
|
||||
keys = [
|
||||
("A", "accept all intercepted flows"),
|
||||
("a", "accept this intercepted flow"),
|
||||
("b", "save request/response body"),
|
||||
("C", "clear flow list or eventlog"),
|
||||
("d", "delete flow"),
|
||||
("D", "duplicate flow"),
|
||||
@ -228,6 +229,18 @@ class ConnectionItem(common.WWrap):
|
||||
self.state,
|
||||
self.flow.request,
|
||||
)
|
||||
elif key == "b":
|
||||
self.master.prompt_onekey(
|
||||
"Save",
|
||||
(
|
||||
("request", "q"),
|
||||
("response", "r"),
|
||||
),
|
||||
common.which_body_save,
|
||||
self.master,
|
||||
self.state,
|
||||
self.flow,
|
||||
)
|
||||
else:
|
||||
return key
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user