Fixed #26024 -- Fixed regression in ConditionalGetMiddleware ETag support.

Thanks Denis Cornehl for help with the patch.
This commit is contained in:
Denis Cornehl 2016-01-05 08:09:10 +01:00 committed by Tim Graham
parent d5b90c8e12
commit 186b6c61bf
6 changed files with 21 additions and 7 deletions

View file

@ -470,6 +470,11 @@ class ConditionalGetMiddlewareTest(SimpleTestCase):
self.resp = ConditionalGetMiddleware().process_response(self.req, self.resp)
self.assertEqual(self.resp.status_code, 304)
def test_if_none_match_and_same_etag_with_quotes(self):
self.req.META['HTTP_IF_NONE_MATCH'] = self.resp['ETag'] = '"spam"'
self.resp = ConditionalGetMiddleware().process_response(self.req, self.resp)
self.assertEqual(self.resp.status_code, 304)
def test_if_none_match_and_different_etag(self):
self.req.META['HTTP_IF_NONE_MATCH'] = 'spam'
self.resp['ETag'] = 'eggs'