mirror of
https://github.com/django/django.git
synced 2025-10-17 22:07:29 +00:00
Fixed #26765 -- Made CommonMiddleware no longer set an ETag when response has Cache-Control: no-store.
This commit is contained in:
parent
ba246bd5fe
commit
20d39325ca
2 changed files with 25 additions and 2 deletions
|
@ -275,6 +275,20 @@ class CommonMiddlewareTest(SimpleTestCase):
|
|||
res = StreamingHttpResponse(['content'])
|
||||
self.assertFalse(CommonMiddleware().process_response(req, res).has_header('ETag'))
|
||||
|
||||
@override_settings(USE_ETAGS=True)
|
||||
def test_no_etag_no_store_cache(self):
|
||||
req = HttpRequest()
|
||||
res = HttpResponse('content')
|
||||
res['Cache-Control'] = 'No-Cache, No-Store, Max-age=0'
|
||||
self.assertFalse(CommonMiddleware().process_response(req, res).has_header('ETag'))
|
||||
|
||||
@override_settings(USE_ETAGS=True)
|
||||
def test_etag_extended_cache_control(self):
|
||||
req = HttpRequest()
|
||||
res = HttpResponse('content')
|
||||
res['Cache-Control'] = 'my-directive="my-no-store"'
|
||||
self.assertTrue(CommonMiddleware().process_response(req, res).has_header('ETag'))
|
||||
|
||||
@override_settings(USE_ETAGS=True)
|
||||
def test_if_none_match(self):
|
||||
first_req = HttpRequest()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue