Merge pull request #1502 from matclab/issue_1500
Allow cookie to contains several '='
This commit is contained in:
commit
77968b5034
2 files changed
+30
-6
No files matched your search
@@ -49,6 +49,24 @@ def stopwebserver():
|
||||
webserverprocess.terminate()
|
||||
|
||||
|
||||
class Cookie(unittest.TestCase):
|
||||
def testParseMultipleEquals(self):
|
||||
""" Test for issue #1500.
|
||||
Ensure that a cookie containing one or more '=' is correctly parsed
|
||||
"""
|
||||
client = WebClient()
|
||||
client.headers['set-cookie'] = "key = value with one =;"
|
||||
client._parse_headers_in_cookies()
|
||||
self.assertIn("key", client.cookies)
|
||||
self.assertEqual(client.cookies['key'], "value with one =")
|
||||
|
||||
client.headers['set-cookie'] = "key = value with one = and another one =;"
|
||||
client._parse_headers_in_cookies()
|
||||
client._parse_headers_in_cookies()
|
||||
self.assertIn("key", client.cookies)
|
||||
self.assertEqual(client.cookies['key'], "value with one = and another one =")
|
||||
|
||||
|
||||
class LiveTest(unittest.TestCase):
|
||||
|
||||
@classmethod
|
||||
|
||||
Reference in new issue
Block a user