mirror of
https://github.com/kevin1024/vcrpy.git
synced 2025-12-10 09:35:34 +00:00
aiohttp: Ignore cookie expiration date
This commit is contained in:
committed by
Kevin McCarthy
parent
20fb283e97
commit
1b9f80d741
@@ -75,7 +75,13 @@ def build_response(vcr_request, vcr_response, history):
|
|||||||
# cookies
|
# cookies
|
||||||
for hdr in response.headers.getall(hdrs.SET_COOKIE, ()):
|
for hdr in response.headers.getall(hdrs.SET_COOKIE, ()):
|
||||||
try:
|
try:
|
||||||
response.cookies.load(hdr)
|
cookies = SimpleCookie(hdr)
|
||||||
|
for cookie_name, cookie in cookies.items():
|
||||||
|
expires = cookie.get('expires', '').strip()
|
||||||
|
if expires:
|
||||||
|
log.debug("Ignoring expiration date: %s=\"%s\"", cookie_name, expires)
|
||||||
|
cookie['expires'] = ''
|
||||||
|
response.cookies.load(cookie.output(header='').strip())
|
||||||
except CookieError as exc:
|
except CookieError as exc:
|
||||||
log.warning("Can not load response cookies: %s", exc)
|
log.warning("Can not load response cookies: %s", exc)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user