added support for 'b' key in flowlist

This commit is contained in:
Marcelo Glezer 2015-01-16 13:08:25 -03:00
parent d80e2e2b2b
commit e5922ae30a
2 changed files with 41 additions and 0 deletions

View File

@ -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:

View File

@ -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