Allow cookie to contains several '='

close #1500
This commit is contained in:
Mathieu Clabaut
2016-10-09 21:48:10 +02:00
parent e6a3081b42
commit 3f96c521f3
2 changed files with 30 additions and 6 deletions
+18
View File
@@ -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