Add an indicator that sticky cookies have been applied in mitmdump.
This commit is contained in:
parent
8cade9fbbf
commit
6921b9ff2a
|
@ -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):
|
||||
|
|
|
@ -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())
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue