mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 00:01:36 +00:00
added support for 'b' key in flowlist
This commit is contained in:
parent
9fc68d320c
commit
ae83d39eba
@ -189,8 +189,36 @@ def ask_save_body(k, master, state, content):
|
|||||||
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
|
## common copy_message parts
|
||||||
def copy_message( k, master, state, message):
|
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 pyperclip:
|
||||||
if k == "c":
|
if k == "c":
|
||||||
try:
|
try:
|
||||||
|
@ -7,6 +7,7 @@ def _mkhelp():
|
|||||||
keys = [
|
keys = [
|
||||||
("A", "accept all intercepted flows"),
|
("A", "accept all intercepted flows"),
|
||||||
("a", "accept this intercepted flow"),
|
("a", "accept this intercepted flow"),
|
||||||
|
("b", "save request/response body"),
|
||||||
("C", "clear flow list or eventlog"),
|
("C", "clear flow list or eventlog"),
|
||||||
("d", "delete flow"),
|
("d", "delete flow"),
|
||||||
("D", "duplicate flow"),
|
("D", "duplicate flow"),
|
||||||
@ -230,6 +231,18 @@ class ConnectionItem(common.WWrap):
|
|||||||
self.state,
|
self.state,
|
||||||
self.flow.request,
|
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:
|
else:
|
||||||
return key
|
return key
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user