Skip to content

Commit

Permalink
Fixed #920 -- Fixed patch_response_headers() behavior when content is…
Browse files Browse the repository at this point in the history
… Unicode. Thanks, Sune Kirkeby

git-svn-id: http://code.djangoproject.com/svn/django/trunk@1980 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
adrianholovaty committed Jan 15, 2006
1 parent 44e6ce6 commit d862908
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion django/utils/cache.py
Expand Up @@ -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'):
Expand Down

0 comments on commit d862908

Please sign in to comment.