diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2011-03-11 11:56:10 +1300 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2011-03-11 11:56:10 +1300 |
commit | daa9653ebebe73e1056d6dae14b11b0842ecbc2a (patch) | |
tree | 570350fc9807ea7c58a77f1bd3f31e950b86cc33 /test/test_proxy.py | |
parent | e99b1d1949c6a140895f8f10c4863ec41528cccf (diff) | |
download | mitmproxy-daa9653ebebe73e1056d6dae14b11b0842ecbc2a.tar.gz mitmproxy-daa9653ebebe73e1056d6dae14b11b0842ecbc2a.tar.bz2 mitmproxy-daa9653ebebe73e1056d6dae14b11b0842ecbc2a.zip |
Add --norefresh to stop refreshing server playback to mitmdump.
Also, make cookie parsing for refreshing more error-tolerant.
Diffstat (limited to 'test/test_proxy.py')
-rw-r--r-- | test/test_proxy.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/test_proxy.py b/test/test_proxy.py index a449071c..6bae46fc 100644 --- a/test/test_proxy.py +++ b/test/test_proxy.py @@ -132,6 +132,17 @@ class uResponse(libpry.AutoTree): r.headers["set-cookie"] = ["MOO=BAR; Expires=Tue, 08-Mar-2011 00:20:38 GMT; Path=foo.com; Secure"] r.refresh() + def test_refresh_cookie(self): + r = tutils.tresp() + + # Invalid expires format, sent to us by Reddit. + c = "rfoo=bar; Domain=reddit.com; expires=Thu, 31 Dec 2037 23:59:59 GMT; Path=/" + assert r._refresh_cookie(c, 60) + + c = "MOO=BAR; Expires=Tue, 08-Mar-2011 00:20:38 GMT; Path=foo.com; Secure" + assert "00:21:38" in r._refresh_cookie(c, 60) + + def test_getset_state(self): h = utils.Headers() h["test"] = ["test"] |