diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2019-09-13 11:47:51 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-13 11:47:51 (GMT) |
commit | 44cb89a78a308b7a613bdd01539ec84be914d693 (patch) | |
tree | 05cb269aab75c3a5a87afbffd7132506123da018 /Lib/http | |
parent | b9bfe143d151d184615fa3890f78874c5d4ed4c6 (diff) | |
download | cpython-44cb89a78a308b7a613bdd01539ec84be914d693.zip cpython-44cb89a78a308b7a613bdd01539ec84be914d693.tar.gz cpython-44cb89a78a308b7a613bdd01539ec84be914d693.tar.bz2 |
bpo-12144: Handle cookies with expires attribute in CookieJar.make_cookies (GH-13921)
Handle time comparison for cookies with `expires` attribute when `CookieJar.make_cookies` is called.
Co-authored-by: Demian Brecht <demianbrecht@gmail.com>
https://bugs.python.org/issue12144
Automerge-Triggered-By: @asvetlov
(cherry picked from commit bb41147eab15a2958f4ad38261e5bf608f6ace1b)
Co-authored-by: Xtreak <tir.karthi@gmail.com>
Diffstat (limited to 'Lib/http')
-rw-r--r-- | Lib/http/cookiejar.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/http/cookiejar.py b/Lib/http/cookiejar.py index db82382..adc7ed6 100644 --- a/Lib/http/cookiejar.py +++ b/Lib/http/cookiejar.py @@ -1593,6 +1593,7 @@ class CookieJar: headers = response.info() rfc2965_hdrs = headers.get_all("Set-Cookie2", []) ns_hdrs = headers.get_all("Set-Cookie", []) + self._policy._now = self._now = int(time.time()) rfc2965 = self._policy.rfc2965 netscape = self._policy.netscape @@ -1672,8 +1673,6 @@ class CookieJar: _debug("extract_cookies: %s", response.info()) self._cookies_lock.acquire() try: - self._policy._now = self._now = int(time.time()) - for cookie in self.make_cookies(response, request): if self._policy.set_ok(cookie, request): _debug(" setting cookie: %s", cookie) |