aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/utils.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2011-02-24 15:15:51 +1300
committerAldo Cortesi <aldo@nullcube.com>2011-02-24 15:26:34 +1300
commit79039eb5d23b6f7076664a3383988cd6b51e377e (patch)
tree855af0a2980721d55fe3bedf4af8a8f0cb759f4d /libmproxy/utils.py
parent57947b328ec0faba24e4682f7e4cb9074b81b684 (diff)
downloadmitmproxy-79039eb5d23b6f7076664a3383988cd6b51e377e.tar.gz
mitmproxy-79039eb5d23b6f7076664a3383988cd6b51e377e.tar.bz2
mitmproxy-79039eb5d23b6f7076664a3383988cd6b51e377e.zip
More mature sticky cookie primitive. Use it in console.py.
Diffstat (limited to 'libmproxy/utils.py')
-rw-r--r--libmproxy/utils.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/libmproxy/utils.py b/libmproxy/utils.py
index afef8e63..c67b9397 100644
--- a/libmproxy/utils.py
+++ b/libmproxy/utils.py
@@ -172,6 +172,10 @@ class MultiDict:
key = self._helper[0](key)
return self._d.get(key, d)
+ def __contains__(self, key):
+ key = self._helper[0](key)
+ return self._d.__contains__(key)
+
def __eq__(self, other):
return dict(self) == dict(other)
@@ -192,6 +196,10 @@ class MultiDict:
key = self._helper[0](key)
return self._d.has_key(key)
+ def setdefault(self, key, default=None):
+ key = self._helper[0](key)
+ return self._d.setdefault(key, default)
+
def keys(self):
return self._d.keys()