summaryrefslogtreecommitdiff
path: root/django/utils/http.py
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2017-12-30 14:19:43 -0500
committerTim Graham <timograham@gmail.com>2018-01-02 11:23:04 -0500
commitab7f4c330629f24f006a35729ee0d758711312fa (patch)
tree401b2b950fa96577e61cc7cc0132187e274ddfe0 /django/utils/http.py
parent0afffae4ecb660f2ecb94a756c2ab7729654ecf6 (diff)
Refs #28965 -- Deprecated unused django.utils.http.cookie_date().
Diffstat (limited to 'django/utils/http.py')
-rw-r--r--django/utils/http.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/django/utils/http.py b/django/utils/http.py
index c1c616a6fd..2148630fd3 100644
--- a/django/utils/http.py
+++ b/django/utils/http.py
@@ -3,6 +3,7 @@ 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 (
@@ -13,6 +14,7 @@ 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.encoding import force_bytes
from django.utils.functional import keep_lazy_text
@@ -118,6 +120,11 @@ def cookie_date(epoch_seconds=None):
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])