1
0
mirror of https://github.com/httpie/cli.git synced 2026-06-20 11:32:56 +02:00

Add support for max-age=0 cookie expiry (#1029)

Close #998
This commit is contained in:
Denis Belavin
2021-02-06 12:50:34 +03:00
committed by GitHub
parent cf78a12e46
commit 3c07a25326
3 changed files with 19 additions and 0 deletions
+9
View File
@@ -109,6 +109,15 @@ def get_expired_cookies(
for attrs in attr_sets
]
# HACK/FIXME: https://github.com/psf/requests/issues/5743
for cookie in cookies:
if 'expires' in cookie:
continue
max_age = cookie.get('max-age')
if max_age and max_age.isdigit():
cookie['expires'] = now + float(max_age)
return [
{
'name': cookie['name'],