Add an indicator that sticky cookies have been applied in mitmdump.

This commit is contained in:
Aldo Cortesi 2011-02-25 21:23:44 +13:00
parent 8cade9fbbf
commit 6921b9ff2a
4 changed files with 12 additions and 1 deletions

View File

@ -31,7 +31,10 @@ def str_response(resp):
def str_request(req):
return "%s %s"%(req.method, req.url())
r = "%s %s"%(req.method, req.url())
if req.stickycookie:
r = "[stickycookie] " + r
return r
class DumpMaster(flow.FlowMaster):

View File

@ -126,6 +126,7 @@ class StickyCookieState:
]
if all(match):
l = f.request.headers.setdefault("cookie", [])
f.request.stickycookie = True
l.append(self.jar[i].output(header="").strip())

View File

@ -136,6 +136,9 @@ class Request(controller.Msg):
self.close = False
controller.Msg.__init__(self)
# Have this request's cookies been modified by sticky cookies?
self.stickycookie = False
def set_replay(self):
self.client_conn = None

View File

@ -10,6 +10,10 @@ class uStrFuncs(libpry.AutoTree):
t.set_replay()
dump.str_response(t)
t = utils.treq()
t.stickycookie = True
assert "stickycookie" in dump.str_request(t)
class uDumpMaster(libpry.AutoTree):
def _cycle(self, m, content):