diff options
| author | Alexey <lesha.ogonkov@gmail.com> | 2017-12-28 00:49:46 +0300 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2018-01-02 11:22:59 -0500 |
| commit | 0afffae4ecb660f2ecb94a756c2ab7729654ecf6 (patch) | |
| tree | 70bab826d6925834a9d43b27c90a8ff592653a8b /django/http | |
| parent | 5f456408a0f52dc16f627d4a89ced5f52c36ad2f (diff) | |
Fixed #28965 -- Updated Set-Cookie's Expires date format to follow RFC 7231.
Diffstat (limited to 'django/http')
| -rw-r--r-- | django/http/response.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/django/http/response.py b/django/http/response.py index c07dc5b6e0..76d731d53f 100644 --- a/django/http/response.py +++ b/django/http/response.py @@ -14,7 +14,7 @@ from django.core.serializers.json import DjangoJSONEncoder from django.http.cookie import SimpleCookie from django.utils import timezone from django.utils.encoding import force_bytes, iri_to_uri -from django.utils.http import cookie_date +from django.utils.http import http_date _charset_from_content_type_re = re.compile(r';\s*charset=(?P<charset>[^\s;]+)', re.I) @@ -185,8 +185,7 @@ class HttpResponseBase: self.cookies[key]['max-age'] = max_age # IE requires expires, so set it if hasn't been already. if not expires: - self.cookies[key]['expires'] = cookie_date(time.time() + - max_age) + self.cookies[key]['expires'] = http_date(time.time() + max_age) if path is not None: self.cookies[key]['path'] = path if domain is not None: @@ -207,7 +206,7 @@ class HttpResponseBase: def delete_cookie(self, key, path='/', domain=None): self.set_cookie(key, max_age=0, path=path, domain=domain, - expires='Thu, 01-Jan-1970 00:00:00 GMT') + expires='Thu, 01 Jan 1970 00:00:00 GMT') # Common methods used by subclasses |
