aboutsummaryrefslogtreecommitdiffstats
path: root/test/netlib/http/test_cookies.py
diff options
context:
space:
mode:
authorThomas Kriechbaumer <Kriechi@users.noreply.github.com>2016-05-11 12:30:44 -0500
committerThomas Kriechbaumer <Kriechi@users.noreply.github.com>2016-05-11 12:30:44 -0500
commitbef72c1b02a4f6e374224279506bde17ce2f79db (patch)
treeb4ca6d2c18078ccda9587d06b3336eb35f3f3a75 /test/netlib/http/test_cookies.py
parente34b2d7e6518220258ba4975321efa91c07b9007 (diff)
parente2ee48a0ee8e6f6426686f8f7b06570cea20b236 (diff)
downloadmitmproxy-bef72c1b02a4f6e374224279506bde17ce2f79db.tar.gz
mitmproxy-bef72c1b02a4f6e374224279506bde17ce2f79db.tar.bz2
mitmproxy-bef72c1b02a4f6e374224279506bde17ce2f79db.zip
Merge pull request #1121 from Kriechi/fix-cookies
improve cookie parsing
Diffstat (limited to 'test/netlib/http/test_cookies.py')
-rw-r--r--test/netlib/http/test_cookies.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/test/netlib/http/test_cookies.py b/test/netlib/http/test_cookies.py
index 3b520a44..da28850f 100644
--- a/test/netlib/http/test_cookies.py
+++ b/test/netlib/http/test_cookies.py
@@ -228,7 +228,16 @@ def test_refresh_cookie():
c = "MOO=BAR; Expires=Tue, 08-Mar-2011 00:20:38 GMT; Path=foo.com; Secure"
assert "00:21:38" in cookies.refresh_set_cookie_header(c, 60)
+ c = "foo,bar"
+ with raises(ValueError):
+ cookies.refresh_set_cookie_header(c, 60)
+
# https://github.com/mitmproxy/mitmproxy/issues/773
c = ">=A"
- with raises(ValueError):
- cookies.refresh_set_cookie_header(c, 60) \ No newline at end of file
+ assert cookies.refresh_set_cookie_header(c, 60)
+
+ # https://github.com/mitmproxy/mitmproxy/issues/1118
+ c = "foo:bar=bla"
+ assert cookies.refresh_set_cookie_header(c, 0)
+ c = "foo/bar=bla"
+ assert cookies.refresh_set_cookie_header(c, 0)