summaryrefslogtreecommitdiff
path: root/django/utils
diff options
context:
space:
mode:
Diffstat (limited to 'django/utils')
-rw-r--r--django/utils/cache.py14
-rw-r--r--django/utils/httpwrappers.py4
2 files changed, 9 insertions, 9 deletions
diff --git a/django/utils/cache.py b/django/utils/cache.py
index ed6e3f11ea..b36753b558 100644
--- a/django/utils/cache.py
+++ b/django/utils/cache.py
@@ -22,19 +22,19 @@ from django.conf import settings
from django.core.cache import cache
cc_delim_re = re.compile(r'\s*,\s*')
+
def patch_cache_control(response, **kwargs):
"""
This function patches the Cache-Control header by adding all
keyword arguments to it. The transformation is as follows:
- - all keyword parameter names are turned to lowercase and
- all _ will be translated to -
- - if the value of a parameter is True (exatly True, not just a
- true value), only the parameter name is added to the header
- - all other parameters are added with their value, after applying
- str to it.
+ * All keyword parameter names are turned to lowercase, and underscores
+ are converted to hyphens.
+ * If the value of a parameter is True (exactly True, not just a
+ true value), only the parameter name is added to the header.
+ * All other parameters are added with their value, after applying
+ str() to it.
"""
-
def dictitem(s):
t = s.split('=',1)
if len(t) > 1:
diff --git a/django/utils/httpwrappers.py b/django/utils/httpwrappers.py
index 5f9362bd24..c1aa9d6ee1 100644
--- a/django/utils/httpwrappers.py
+++ b/django/utils/httpwrappers.py
@@ -172,9 +172,9 @@ class HttpResponse:
return True
return False
- def set_cookie(self, key, value='', max_age=None, path='/', domain=None, secure=None):
+ def set_cookie(self, key, value='', max_age=None, expires=None, path='/', domain=None, secure=None):
self.cookies[key] = value
- for var in ('max_age', 'path', 'domain', 'secure'):
+ for var in ('max_age', 'path', 'domain', 'secure', 'expires'):
val = locals()[var]
if val is not None:
self.cookies[key][var.replace('_', '-')] = val