aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2011-02-25 17:32:03 +1300
committerAldo Cortesi <aldo@nullcube.com>2011-02-25 17:32:03 +1300
commit3792b0084ea25e49a1a20783b6ce387fc04fc6a8 (patch)
tree62358ceb8ec0abae4ba85cb2ad510ad106c8eb0b /libmproxy
parent57f96c5fe014420a09ed42e96f67562fabe33048 (diff)
downloadmitmproxy-3792b0084ea25e49a1a20783b6ce387fc04fc6a8.tar.gz
mitmproxy-3792b0084ea25e49a1a20783b6ce387fc04fc6a8.tar.bz2
mitmproxy-3792b0084ea25e49a1a20783b6ce387fc04fc6a8.zip
Add -c and -C options to mitmdump to control sticky cookies.
It's dumb that this needs to be two different options, but optparse doesn't support optional arguments. It would be much nicer to just have "-c" for "all", and "-c filter" for a specified filter.
Diffstat (limited to 'libmproxy')
-rw-r--r--libmproxy/dump.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/libmproxy/dump.py b/libmproxy/dump.py
index 396dc31d..c1f89d88 100644
--- a/libmproxy/dump.py
+++ b/libmproxy/dump.py
@@ -13,6 +13,7 @@ class Options(object):
"verbosity",
"wfile",
"rheaders",
+ "stickycookie",
]
def __init__(self, **kwargs):
for k, v in kwargs.items():
@@ -38,6 +39,9 @@ class DumpMaster(flow.FlowMaster):
if self.o.request_script:
self.set_request_script(self.o.request_script)
+ if options.stickycookie:
+ self.set_stickycookie(options.stickycookie)
+
if options.wfile:
path = os.path.expanduser(options.wfile)
try:
@@ -55,6 +59,7 @@ class DumpMaster(flow.FlowMaster):
raise DumpError(v.strerror)
self.start_playback(flows, options.kill, options.rheaders)
+
def _runscript(self, f, script):
try:
ret = f.run_script(script)