diff options
| author | Tim Graham <timograham@gmail.com> | 2018-12-27 20:35:20 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2019-01-17 10:52:19 -0500 |
| commit | 958a7b4ca69434d0145fd569cf007e21841bb36c (patch) | |
| tree | 6652f46a4edf7a6f9592b216a2c47c9f66803697 /django/utils/http.py | |
| parent | 6f23996a597a302e2a3cac265f70b48f4aa02b11 (diff) | |
Refs #28965 -- Removed utils.http.cookie_date() per deprecation timeline.
Diffstat (limited to 'django/utils/http.py')
| -rw-r--r-- | django/utils/http.py | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/django/utils/http.py b/django/utils/http.py index de1ea71368..7b4f4996d7 100644 --- a/django/utils/http.py +++ b/django/utils/http.py @@ -3,7 +3,6 @@ import calendar import datetime import re import unicodedata -import warnings from binascii import Error as BinasciiError from email.utils import formatdate from urllib.parse import ( @@ -14,7 +13,6 @@ from urllib.parse import ( from django.core.exceptions import TooManyFieldsSent from django.utils.datastructures import MultiValueDict -from django.utils.deprecation import RemovedInDjango30Warning from django.utils.functional import keep_lazy_text # based on RFC 7232, Appendix C @@ -120,25 +118,6 @@ def urlencode(query, doseq=False): return original_urlencode(query_params, doseq) -def cookie_date(epoch_seconds=None): - """ - Format the time to ensure compatibility with Netscape's cookie standard. - - `epoch_seconds` is a floating point number expressed in seconds since the - epoch, in UTC - such as that outputted by time.time(). If set to None, it - defaults to the current time. - - Output a string in the format 'Wdy, DD-Mon-YYYY HH:MM:SS GMT'. - """ - warnings.warn( - 'cookie_date() is deprecated in favor of http_date(), which follows ' - 'the format of the latest RFC.', - RemovedInDjango30Warning, stacklevel=2, - ) - rfcdate = formatdate(epoch_seconds) - return '%s-%s-%s GMT' % (rfcdate[:7], rfcdate[8:11], rfcdate[12:25]) - - def http_date(epoch_seconds=None): """ Format the time to match the RFC1123 date format as specified by HTTP |
