summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2019-06-10 18:47:35 +0300
committerIgor Sysoev <igor@sysoev.ru>2019-06-10 18:47:35 +0300
commit1f8c395fc0bc9d1a18391a2ae3b0f282b91ff19c (patch)
tree4aea9e540bc49f421337901561fad323c512cdc0 /test
parentb2a06204838096f03a41aac9a3a365a04f6b719a (diff)
downloadunit-1f8c395fc0bc9d1a18391a2ae3b0f282b91ff19c.tar.gz
unit-1f8c395fc0bc9d1a18391a2ae3b0f282b91ff19c.tar.bz2
Cookie-based routing should be case-sensitive.
Diffstat (limited to '')
-rw-r--r--test/test_routing.py33
1 files changed, 22 insertions, 11 deletions
diff --git a/test/test_routing.py b/test/test_routing.py
index ac2e0de8..ef917ea2 100644
--- a/test/test_routing.py
+++ b/test/test_routing.py
@@ -2423,7 +2423,7 @@ class TestRouting(TestApplicationProto):
self.get(
headers={
'Host': 'localhost',
- 'Cookie': 'foo=bar',
+ 'Cookie': 'foO=bar',
'Connection': 'close',
},
)['status'],
@@ -2434,7 +2434,7 @@ class TestRouting(TestApplicationProto):
self.get(
headers={
'Host': 'localhost',
- 'Cookie': ['foo=bar', 'blah=blah'],
+ 'Cookie': ['foO=bar', 'blah=blah'],
'Connection': 'close',
},
)['status'],
@@ -2445,7 +2445,7 @@ class TestRouting(TestApplicationProto):
self.get(
headers={
'Host': 'localhost',
- 'Cookie': 'foo=bar; blah=blah',
+ 'Cookie': 'foO=bar; blah=blah',
'Connection': 'close',
},
)['status'],
@@ -2461,25 +2461,25 @@ class TestRouting(TestApplicationProto):
'Connection': 'close',
},
)['status'],
- 200,
- 'match cookies case insensitive',
+ 404,
+ 'match cookies case sensitive',
)
self.assertEqual(
self.get(
headers={
'Host': 'localhost',
- 'Cookie': 'foo=Bar',
+ 'Cookie': 'foO=Bar',
'Connection': 'close',
},
)['status'],
- 200,
- 'match cookies case insensitive 2',
+ 404,
+ 'match cookies case sensitive 2',
)
self.assertEqual(
self.get(
headers={
'Host': 'localhost',
- 'Cookie': 'foo=bar1',
+ 'Cookie': 'foO=bar1',
'Connection': 'close',
},
)['status'],
@@ -2490,13 +2490,24 @@ class TestRouting(TestApplicationProto):
self.get(
headers={
'Host': 'localhost',
- 'Cookie': 'foo=bar;',
+ 'Cookie': '1foO=bar;',
'Connection': 'close',
},
)['status'],
- 200,
+ 404,
'match cookies exact 2',
)
+ self.assertEqual(
+ self.get(
+ headers={
+ 'Host': 'localhost',
+ 'Cookie': 'foO=bar;1',
+ 'Connection': 'close',
+ },
+ )['status'],
+ 200,
+ 'match cookies exact 3',
+ )
def test_routes_match_cookies_empty(self):
self.assertIn(