Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
  • Loading branch information...
commit d862908b67aa1414748423ad6b9332902329a67d 1 parent 44e6ce6
Adrian Holovaty authored January 15, 2006

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. 2  django/utils/cache.py
2  django/utils/cache.py
@@ -75,7 +75,7 @@ def patch_response_headers(response, cache_timeout=None):
75 75
     now = datetime.datetime.utcnow()
76 76
     expires = now + datetime.timedelta(0, cache_timeout)
77 77
     if not response.has_header('ETag'):
78  
-        response['ETag'] = md5.new(response.content).hexdigest()
  78
+        response['ETag'] = md5.new(response.get_content_as_string('utf8')).hexdigest()
79 79
     if not response.has_header('Last-Modified'):
80 80
         response['Last-Modified'] = now.strftime('%a, %d %b %Y %H:%M:%S GMT')
81 81
     if not response.has_header('Expires'):

0 notes on commit d862908

Please sign in to comment.
Something went wrong with that request. Please try again.