From 0e7299e10ad527824953be217803f61526919d4b Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Sun, 12 Aug 2007 13:10:45 +0000 Subject: [PATCH] Fixed #4994 -- Send back set-cookie headers in "not modified" responses. Well spotted, colin@owlfish.com. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5878 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/middleware/common.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/django/middleware/common.py b/django/middleware/common.py index d238bb182d..e18ec079af 100644 --- a/django/middleware/common.py +++ b/django/middleware/common.py @@ -80,7 +80,9 @@ class CommonMiddleware(object): else: etag = md5.new(response.content).hexdigest() if response.status_code >= 200 and response.status_code < 300 and request.META.get('HTTP_IF_NONE_MATCH') == etag: + cookies = response.cookies response = http.HttpResponseNotModified() + response.cookies = cookies else: response['ETag'] = etag