1
0
mirror of https://github.com/httpie/cli.git synced 2025-08-10 22:42:05 +02:00

Gracefully ignore cookie expiry dates in invalid format

Close #963
This commit is contained in:
Jakub Roztocil
2020-09-20 09:21:10 +02:00
parent 100872b5cf
commit 16ef08a159
2 changed files with 18 additions and 3 deletions

View File

@@ -366,6 +366,15 @@ class TestExpiredCookies(CookieTestBase):
{'name': 'pea', 'path': '/ab'}
]
),
(
# Checks we gracefully ignore expires date in invalid format.
# <https://github.com/httpie/httpie/issues/963>
[
('Set-Cookie', 'pfg=; Expires=Sat, 19-Sep-2020 06:58:14 GMT+0000; Max-Age=0; path=/; domain=.tumblr.com; secure; HttpOnly'),
],
None,
[]
),
(
[
('Set-Cookie', 'hello=world; Path=/; Expires=Fri, 12 Jun 2020 12:28:55 GMT; HttpOnly'),
@@ -373,7 +382,7 @@ class TestExpiredCookies(CookieTestBase):
],
datetime(2020, 6, 11).timestamp(),
[]
)
),
]
)
def test_get_expired_cookies_manages_multiple_cookie_headers(self, headers, now, expected_expired):