summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2006-01-15 06:22:24 +0000
committerAdrian Holovaty <adrian@holovaty.com>2006-01-15 06:22:24 +0000
commitd862908b67aa1414748423ad6b9332902329a67d (patch)
treefdfa8f38ac2f1e82eb92f63299ca0b08e1143eeb
parent44e6ce655291ea3bd5ff47c09754ef0fb998f36f (diff)
Fixed #920 -- Fixed patch_response_headers() behavior when content is Unicode. Thanks, Sune Kirkeby
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1980 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/utils/cache.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/utils/cache.py b/django/utils/cache.py
index b36753b558..4c7d0bb840 100644
--- a/django/utils/cache.py
+++ b/django/utils/cache.py
@@ -75,7 +75,7 @@ def patch_response_headers(response, cache_timeout=None):
now = datetime.datetime.utcnow()
expires = now + datetime.timedelta(0, cache_timeout)
if not response.has_header('ETag'):
- response['ETag'] = md5.new(response.content).hexdigest()
+ response['ETag'] = md5.new(response.get_content_as_string('utf8')).hexdigest()
if not response.has_header('Last-Modified'):
response['Last-Modified'] = now.strftime('%a, %d %b %Y %H:%M:%S GMT')
if not response.has_header('Expires'):