aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
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()