mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-27 02:24:18 +00:00
Add a built-in query string editor using KVEditor.
This commit is contained in:
parent
2709441d5b
commit
00d3395359
@ -368,6 +368,9 @@ class ConnectionView(common.WWrap):
|
|||||||
def set_headers(self, lst, conn):
|
def set_headers(self, lst, conn):
|
||||||
conn.headers = flow.Headers(lst)
|
conn.headers = flow.Headers(lst)
|
||||||
|
|
||||||
|
def set_query(self, lst, conn):
|
||||||
|
conn.set_query(lst)
|
||||||
|
|
||||||
def edit(self, part):
|
def edit(self, part):
|
||||||
if self.state.view_flow_mode == common.VIEW_FLOW_REQUEST:
|
if self.state.view_flow_mode == common.VIEW_FLOW_REQUEST:
|
||||||
conn = self.flow.request
|
conn = self.flow.request
|
||||||
@ -382,6 +385,8 @@ class ConnectionView(common.WWrap):
|
|||||||
conn.content = c.rstrip("\n")
|
conn.content = c.rstrip("\n")
|
||||||
elif part == "h":
|
elif part == "h":
|
||||||
self.master.view_kveditor("Editing headers", conn.headers.lst, self.set_headers, conn)
|
self.master.view_kveditor("Editing headers", conn.headers.lst, self.set_headers, conn)
|
||||||
|
elif part == "q":
|
||||||
|
self.master.view_kveditor("Editing query", conn.get_query(), self.set_query, conn)
|
||||||
elif part == "u" and self.state.view_flow_mode == common.VIEW_FLOW_REQUEST:
|
elif part == "u" and self.state.view_flow_mode == common.VIEW_FLOW_REQUEST:
|
||||||
self.master.prompt_edit("URL", conn.get_url(), self.set_url)
|
self.master.prompt_edit("URL", conn.get_url(), self.set_url)
|
||||||
elif part == "m" and self.state.view_flow_mode == common.VIEW_FLOW_REQUEST:
|
elif part == "m" and self.state.view_flow_mode == common.VIEW_FLOW_REQUEST:
|
||||||
@ -444,9 +449,10 @@ class ConnectionView(common.WWrap):
|
|||||||
self.master.prompt_onekey(
|
self.master.prompt_onekey(
|
||||||
"Edit request",
|
"Edit request",
|
||||||
(
|
(
|
||||||
|
("query", "q"),
|
||||||
|
("url", "u"),
|
||||||
("header", "h"),
|
("header", "h"),
|
||||||
("raw body", "r"),
|
("raw body", "r"),
|
||||||
("url", "u"),
|
|
||||||
("method", "m"),
|
("method", "m"),
|
||||||
),
|
),
|
||||||
self.edit
|
self.edit
|
||||||
|
Loading…
Reference in New Issue
Block a user