mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-30 03:14:22 +00:00
refactored export as curl to be 'E' to export and 'c' to as curl command
This commit is contained in:
parent
b2e3d2ce70
commit
9facd190c6
@ -276,6 +276,10 @@ def copy_flow_format_data(part, scope, flow):
|
|||||||
raise ValueError("Unknown part: {}".format(part))
|
raise ValueError("Unknown part: {}".format(part))
|
||||||
return data, False
|
return data, False
|
||||||
|
|
||||||
|
def export_prompt(k, flow):
|
||||||
|
if k == "c":
|
||||||
|
copy_as_curl_command(flow)
|
||||||
|
|
||||||
def copy_as_curl_command(flow):
|
def copy_as_curl_command(flow):
|
||||||
|
|
||||||
if flow.request.content is None or flow.request.content == CONTENT_MISSING:
|
if flow.request.content is None or flow.request.content == CONTENT_MISSING:
|
||||||
|
@ -13,10 +13,10 @@ def _mkhelp():
|
|||||||
("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"),
|
("b", "save request/response body"),
|
||||||
("Z", "copy request as curl command"),
|
|
||||||
("C", "clear flow list or eventlog"),
|
("C", "clear flow list or eventlog"),
|
||||||
("d", "delete flow"),
|
("d", "delete flow"),
|
||||||
("D", "duplicate flow"),
|
("D", "duplicate flow"),
|
||||||
|
("E", "export"),
|
||||||
("e", "toggle eventlog"),
|
("e", "toggle eventlog"),
|
||||||
("F", "toggle follow flow list"),
|
("F", "toggle follow flow list"),
|
||||||
("l", "set limit filter pattern"),
|
("l", "set limit filter pattern"),
|
||||||
@ -255,8 +255,16 @@ class ConnectionItem(urwid.WidgetWrap):
|
|||||||
)
|
)
|
||||||
elif key == "P":
|
elif key == "P":
|
||||||
common.ask_copy_part("a", self.flow, self.master, self.state)
|
common.ask_copy_part("a", self.flow, self.master, self.state)
|
||||||
elif key == "Z":
|
elif key == "E":
|
||||||
common.copy_as_curl_command(self.flow)
|
signals.status_prompt_onekey.send(
|
||||||
|
self,
|
||||||
|
prompt = "Export",
|
||||||
|
keys = (
|
||||||
|
("as curl command", "c"),
|
||||||
|
),
|
||||||
|
callback = common.export_prompt,
|
||||||
|
args = (self.flow,)
|
||||||
|
)
|
||||||
elif key == "b":
|
elif key == "b":
|
||||||
common.ask_save_body(None, self.master, self.state, self.flow)
|
common.ask_save_body(None, self.master, self.state, self.flow)
|
||||||
else:
|
else:
|
||||||
|
@ -25,9 +25,9 @@ def _mkhelp():
|
|||||||
("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"),
|
("b", "save request/response body"),
|
||||||
("Z", "copy as curl command"),
|
|
||||||
("d", "delete flow"),
|
|
||||||
("D", "duplicate flow"),
|
("D", "duplicate flow"),
|
||||||
|
("d", "delete flow"),
|
||||||
|
("E", "export"),
|
||||||
("e", "edit request/response"),
|
("e", "edit request/response"),
|
||||||
("f", "load full body data"),
|
("f", "load full body data"),
|
||||||
("m", "change body display mode for this entity"),
|
("m", "change body display mode for this entity"),
|
||||||
@ -575,8 +575,16 @@ class FlowView(tabs.Tabs):
|
|||||||
callback = self.master.save_one_flow,
|
callback = self.master.save_one_flow,
|
||||||
args = (self.flow,)
|
args = (self.flow,)
|
||||||
)
|
)
|
||||||
elif key == "Z":
|
elif key == "E":
|
||||||
common.copy_as_curl_command(self.flow)
|
signals.status_prompt_onekey.send(
|
||||||
|
self,
|
||||||
|
prompt = "Export",
|
||||||
|
keys = (
|
||||||
|
("as curl command", "c"),
|
||||||
|
),
|
||||||
|
callback = common.export_prompt,
|
||||||
|
args = (self.flow,)
|
||||||
|
)
|
||||||
elif key == "|":
|
elif key == "|":
|
||||||
signals.status_prompt_path.send(
|
signals.status_prompt_path.send(
|
||||||
prompt = "Send flow to script",
|
prompt = "Send flow to script",
|
||||||
|
Loading…
Reference in New Issue
Block a user