Ugly code to set the cookies when got them from a 302 redirect too

This commit is contained in:
Bernardo Damele
2010-12-03 17:41:10 +00:00
parent 9d55c4da87
commit 5d37df6104
4 changed files with 13 additions and 0 deletions

View File

@@ -26,6 +26,9 @@ class SmartRedirectHandler(urllib2.HTTPRedirectHandler):
elif "uri" in headers:
result.redurl = headers.getheaders("uri")[0].split("?")[0]
if "set-cookie" in headers:
result.setcookie = headers["set-cookie"].split("; path")[0]
result.redcode = code
return result