diff --git a/libmproxy/console.py b/libmproxy/console.py index 5636c180c..ed073f8a9 100644 --- a/libmproxy/console.py +++ b/libmproxy/console.py @@ -1256,7 +1256,11 @@ class ConsoleMaster(flow.FlowMaster): ) k = None elif k == "t": - self.prompt("Sticky cookie: ", self.set_stickycookie) + self.prompt( + "Sticky cookie: ", + self.stickycookie_txt, + self.set_stickycookie + ) k = None if k: self.view.keypress(size, k) diff --git a/libmproxy/flow.py b/libmproxy/flow.py index 7444b4007..e83bbc419 100644 --- a/libmproxy/flow.py +++ b/libmproxy/flow.py @@ -469,8 +469,10 @@ class FlowMaster(controller.Master): if not flt: return "Invalid filter expression." self.stickycookie_state = StickyCookieState(flt) + self.stickycookie_txt = txt else: self.stickycookie_state = None + self.stickycookie_txt = None def start_client_playback(self, flows, exit): """ diff --git a/libmproxy/utils.py b/libmproxy/utils.py index 6568c445b..232edcdf5 100644 --- a/libmproxy/utils.py +++ b/libmproxy/utils.py @@ -75,6 +75,7 @@ def pretty_xmlish(s): A robust pretty-printer for XML-ish data. Returns a list of lines. """ + s = cleanBin(s) data, offset, indent, prev = [], 0, 0, None for i in re.finditer(TAG, s, re.VERBOSE|re.MULTILINE): start, end = i.span()