Revert "http: remove old useless hack for biblio which is useless now"

This reverts commit ddc7a55a00.
This commit is contained in:
Jérôme Schneider 2014-11-12 18:04:23 +01:00
parent 1802dc433a
commit 01fd2a82f6
1 changed files with 4 additions and 0 deletions

View File

@ -154,6 +154,10 @@ class HTTPResponse(object):
self.headers.load_httpmessage(response.headers)
for setcookie in response.headers.getheaders('set-cookie'):
try:
cookie = Cookie.SimpleCookie("Set-Cookie: %s" % setcookie)
cookie = cookie.values()[0]
if self.cookies.has_key(cookie.key):
del self.cookies[cookie.key]
self.cookies.load("Set-Cookie: %s" % setcookie)
except Cookie.CookieError:
logger.warning("can't parse cookie: %r", setcookie)