aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorShadab Zafar <dufferzafar0@gmail.com>2016-07-14 13:07:27 +0530
committerMaximilian Hils <git@maximilianhils.com>2016-07-14 00:37:27 -0700
commit126625584251d6a246ba46943cfa71d5a57fbdda (patch)
tree6431dafb9cda0a752d68b5ac3c16007297568daa /test
parentc852c3c88d6e8cff6ac527993a1c263cce3403ac (diff)
downloadmitmproxy-126625584251d6a246ba46943cfa71d5a57fbdda.tar.gz
mitmproxy-126625584251d6a246ba46943cfa71d5a57fbdda.tar.bz2
mitmproxy-126625584251d6a246ba46943cfa71d5a57fbdda.zip
Re-add deletion of stickycookies (#1355)
This was originally added in #1324 (fixing issue #1096) but got lost during "the big refactor" (#1352)
Diffstat (limited to 'test')
-rw-r--r--test/mitmproxy/builtins/test_stickycookie.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/mitmproxy/builtins/test_stickycookie.py b/test/mitmproxy/builtins/test_stickycookie.py
index 9cf768df..b8d703bd 100644
--- a/test/mitmproxy/builtins/test_stickycookie.py
+++ b/test/mitmproxy/builtins/test_stickycookie.py
@@ -112,6 +112,16 @@ class TestStickyCookie(mastertest.MasterTest):
assert len(sc.jar[googlekey].keys()) == 1
assert list(sc.jar[googlekey]["somecookie"].items())[0][1] == "newvalue"
+ def test_response_delete(self):
+ s, m, sc = self.mk()
+
+ # Test that a cookie is be deleted
+ # by setting the expire time in the past
+ f = self._response(s, m, sc, "duffer=zafar; Path=/", "www.google.com")
+ f.response.headers["Set-Cookie"] = "duffer=; Expires=Thu, 01-Jan-1970 00:00:00 GMT"
+ self.invoke(m, "response", f)
+ assert not sc.jar.keys()
+
def test_request(self):
s, m, sc = self.mk()