mirror of
https://github.com/django/django.git
synced 2025-03-28 10:10:45 +00:00
Fixed #6727 -- Made patch_cache_control() patch an empty Cache-Control header.
This commit is contained in:
parent
1155843a41
commit
1f29164ced
@ -63,7 +63,7 @@ def patch_cache_control(response, **kwargs):
|
|||||||
else:
|
else:
|
||||||
return '%s=%s' % (t[0], t[1])
|
return '%s=%s' % (t[0], t[1])
|
||||||
|
|
||||||
if response.has_header('Cache-Control'):
|
if response.get('Cache-Control'):
|
||||||
cc = cc_delim_re.split(response['Cache-Control'])
|
cc = cc_delim_re.split(response['Cache-Control'])
|
||||||
cc = dict(dictitem(el) for el in cc)
|
cc = dict(dictitem(el) for el in cc)
|
||||||
else:
|
else:
|
||||||
|
1
tests/cache/tests.py
vendored
1
tests/cache/tests.py
vendored
@ -1456,6 +1456,7 @@ class CacheUtils(SimpleTestCase):
|
|||||||
tests = (
|
tests = (
|
||||||
# Initial Cache-Control, kwargs to patch_cache_control, expected Cache-Control parts
|
# Initial Cache-Control, kwargs to patch_cache_control, expected Cache-Control parts
|
||||||
(None, {'private': True}, {'private'}),
|
(None, {'private': True}, {'private'}),
|
||||||
|
('', {'private': True}, {'private'}),
|
||||||
|
|
||||||
# Test whether private/public attributes are mutually exclusive
|
# Test whether private/public attributes are mutually exclusive
|
||||||
('private', {'private': True}, {'private'}),
|
('private', {'private': True}, {'private'}),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user