aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/console/flowview.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2015-04-17 12:54:29 +1200
committerAldo Cortesi <aldo@nullcube.com>2015-04-17 12:54:29 +1200
commite963a9da4887268b03ceecf55086674121047056 (patch)
treecaee7ccf3d8c6d83ad50ac571ebb3a2c8a53f313 /libmproxy/console/flowview.py
parent7abaf3c3626a68a23233c3dc759ade32068f0462 (diff)
downloadmitmproxy-e963a9da4887268b03ceecf55086674121047056.tar.gz
mitmproxy-e963a9da4887268b03ceecf55086674121047056.tar.bz2
mitmproxy-e963a9da4887268b03ceecf55086674121047056.zip
console: suport unary attributes
Attributes with no value are treated as unary, e.g. "Secure" rather than "Secure=". If you really want to have an empty attribute value you can edit the header directly. Behind the scenes, restructure GridEditor to know about data conversion in and out of the editor.
Diffstat (limited to 'libmproxy/console/flowview.py')
-rw-r--r--libmproxy/console/flowview.py21
1 files changed, 4 insertions, 17 deletions
diff --git a/libmproxy/console/flowview.py b/libmproxy/console/flowview.py
index 497248de..632b725e 100644
--- a/libmproxy/console/flowview.py
+++ b/libmproxy/console/flowview.py
@@ -290,7 +290,7 @@ class FlowView(tabs.Tabs):
signals.flow_change.send(self, flow = self.flow)
def set_path_components(self, lst, conn):
- conn.set_path_components([i[0] for i in lst])
+ conn.set_path_components(lst)
signals.flow_change.send(self, flow = self.flow)
def set_form(self, lst, conn):
@@ -316,17 +316,8 @@ class FlowView(tabs.Tabs):
conn.set_cookies(od)
signals.flow_change.send(self, flow = self.flow)
- def set_setcookies(self, lst, conn):
- vals = []
- for i in lst:
- vals.append(
- [
- i[0],
- [i[1], odict.ODictCaseless(i[2])]
- ]
- )
- od = odict.ODict(vals)
- conn.set_cookies(od)
+ def set_setcookies(self, data, conn):
+ conn.set_cookies(data)
signals.flow_change.send(self, flow = self.flow)
def edit(self, part):
@@ -352,13 +343,10 @@ class FlowView(tabs.Tabs):
)
)
if message == self.flow.response and part == "c":
- flattened = []
- for k, v in message.get_cookies().items():
- flattened.append([k, v[0], v[1].lst])
self.master.view_grideditor(
grideditor.SetCookieEditor(
self.master,
- flattened,
+ message.get_cookies(),
self.set_setcookies,
message
)
@@ -397,7 +385,6 @@ class FlowView(tabs.Tabs):
)
elif part == "p":
p = message.get_path_components()
- p = [[i] for i in p]
self.master.view_grideditor(
grideditor.PathEditor(
self.master,