Permalink
Browse files

cookie can now handle more than 1 value being set

  • Loading branch information...
1 parent 401b323 commit 0b9ad1327edde5cccf085506fbedf86c125f62fb @bootandy bootandy committed with Jun 13, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 tornado_utils/http_test_client.py
View
8 tornado_utils/http_test_client.py
@@ -73,8 +73,12 @@ def post(self, url, data, headers=None, follow_redirects=False):
def _update_cookies(self, headers):
try:
sc = headers['Set-Cookie']
- self.cookies.update(Cookie.SimpleCookie(
- escape.native_str(sc)))
+ cookies = escape.native_str(sc)
+ while True:
+ self.cookies.update(Cookie.SimpleCookie(cookies))
+ if cookies.find(',') == -1:
+ break
+ cookies = cookies[cookies.find(',') + len(','):]
except KeyError:
return

0 comments on commit 0b9ad13

Please sign in to comment.