aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2011-02-25 21:23:44 +1300
committerAldo Cortesi <aldo@nullcube.com>2011-02-25 21:23:44 +1300
commit6921b9ff2a3f1f9592704e4b85c4400cad243538 (patch)
treea1971438909ee0132c97385da63ecf9acec5d081 /libmproxy
parent8cade9fbbf15480fd5b9f7410d65c928dd26f652 (diff)
downloadmitmproxy-6921b9ff2a3f1f9592704e4b85c4400cad243538.tar.gz
mitmproxy-6921b9ff2a3f1f9592704e4b85c4400cad243538.tar.bz2
mitmproxy-6921b9ff2a3f1f9592704e4b85c4400cad243538.zip
Add an indicator that sticky cookies have been applied in mitmdump.
Diffstat (limited to 'libmproxy')
-rw-r--r--libmproxy/dump.py5
-rw-r--r--libmproxy/flow.py1
-rw-r--r--libmproxy/proxy.py3
3 files changed, 8 insertions, 1 deletions
diff --git a/libmproxy/dump.py b/libmproxy/dump.py
index fe81eda1..50d4dc4b 100644
--- a/libmproxy/dump.py
+++ b/libmproxy/dump.py
@@ -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):
diff --git a/libmproxy/flow.py b/libmproxy/flow.py
index 8e4db57d..a82b978c 100644
--- a/libmproxy/flow.py
+++ b/libmproxy/flow.py
@@ -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())
diff --git a/libmproxy/proxy.py b/libmproxy/proxy.py
index 286ef3fb..2a2904e5 100644
--- a/libmproxy/proxy.py
+++ b/libmproxy/proxy.py
@@ -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