From e963a9da4887268b03ceecf55086674121047056 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Fri, 17 Apr 2015 12:54:29 +1200 Subject: 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. --- libmproxy/console/flowview.py | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) (limited to 'libmproxy/console/flowview.py') 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, -- cgit v1.2.3