aboutsummaryrefslogtreecommitdiffstats
path: root/mitmproxy/console/flowview.py
diff options
context:
space:
mode:
Diffstat (limited to 'mitmproxy/console/flowview.py')
-rw-r--r--mitmproxy/console/flowview.py52
1 files changed, 28 insertions, 24 deletions
diff --git a/mitmproxy/console/flowview.py b/mitmproxy/console/flowview.py
index c85a9f73..938c8e86 100644
--- a/mitmproxy/console/flowview.py
+++ b/mitmproxy/console/flowview.py
@@ -18,6 +18,7 @@ from mitmproxy.console import grideditor
from mitmproxy.console import searchable
from mitmproxy.console import signals
from mitmproxy.console import tabs
+from mitmproxy.flow import export
from netlib.http import Headers
from netlib.http import status_codes
@@ -32,9 +33,9 @@ def _mkhelp():
("A", "accept all intercepted flows"),
("a", "accept this intercepted flow"),
("b", "save request/response body"),
+ ("C", "export flow to clipboard"),
("D", "duplicate flow"),
("d", "delete flow"),
- ("E", "export"),
("e", "edit request/response"),
("f", "load full body data"),
("m", "change body display mode for this entity"),
@@ -75,8 +76,7 @@ def _mkhelp():
[("text", ": XML")]
),
("M", "change default body display mode"),
- ("p", "previous flow"),
- ("P", "copy request/response (content/headers) to clipboard"),
+ ("E", "export flow to file"),
("r", "replay request"),
("V", "revert changes to request"),
("v", "view body in external viewer"),
@@ -589,20 +589,6 @@ class FlowView(tabs.Tabs):
callback = self.master.save_one_flow,
args = (self.flow,)
)
- elif key == "E":
- signals.status_prompt_onekey.send(
- self,
- prompt = "Export",
- keys = (
- ("as curl command", "c"),
- ("as python code", "p"),
- ("as raw request", "r"),
- ("as locust code", "l"),
- ("as locust task", "t"),
- ),
- callback = common.export_prompt,
- args = (self.flow,)
- )
elif key == "|":
signals.status_prompt_path.send(
prompt = "Send flow to script",
@@ -610,7 +596,7 @@ class FlowView(tabs.Tabs):
args = (self.flow,)
)
- if not conn and key in set(list("befgmxvz")):
+ if not conn and key in set(list("befgmxvzEC")):
signals.status_message.send(
message = "Tab to the request or response",
expire = 1
@@ -663,12 +649,6 @@ class FlowView(tabs.Tabs):
)
signals.flow_change.send(self, flow = self.flow)
signals.status_message.send(message="")
- elif key == "P":
- if self.tab_offset == TAB_REQ:
- scope = "q"
- else:
- scope = "s"
- common.ask_copy_part(scope, self.flow, self.master, self.state)
elif key == "m":
p = list(contentviews.view_prompts)
p.insert(0, ("Clear", "C"))
@@ -679,6 +659,30 @@ class FlowView(tabs.Tabs):
callback = self.change_this_display_mode
)
key = None
+ elif key == "E":
+ if self.tab_offset == TAB_REQ:
+ scope = "q"
+ else:
+ scope = "s"
+ signals.status_prompt_onekey.send(
+ self,
+ prompt = "Export to file",
+ keys = [(e[0], e[1]) for e in export.EXPORTERS],
+ callback = common.export_to_clip_or_file,
+ args = (scope, self.flow, common.ask_save_path)
+ )
+ elif key == "C":
+ if self.tab_offset == TAB_REQ:
+ scope = "q"
+ else:
+ scope = "s"
+ signals.status_prompt_onekey.send(
+ self,
+ prompt = "Export to clipboard",
+ keys = [(e[0], e[1]) for e in export.EXPORTERS],
+ callback = common.export_to_clip_or_file,
+ args = (scope, self.flow, common.copy_to_clipboard_or_prompt)
+ )
elif key == "x":
signals.status_prompt_onekey.send(
prompt = "Delete body",