1
0
mirror of https://github.com/django/django.git synced 2025-10-26 15:16:09 +00:00

Fixed #1569 -- HttpResponse now accepts iterators. Thanks, Maniac

git-svn-id: http://code.djangoproject.com/svn/django/trunk@2639 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty
2006-04-09 23:54:34 +00:00
parent b0a60c186e
commit bc4638d722
7 changed files with 43 additions and 21 deletions

View File

@@ -74,7 +74,7 @@ def patch_response_headers(response, cache_timeout=None):
cache_timeout = settings.CACHE_MIDDLEWARE_SECONDS
now = datetime.datetime.utcnow()
if not response.has_header('ETag'):
response['ETag'] = md5.new(response.get_content_as_string('utf8')).hexdigest()
response['ETag'] = md5.new(response.content).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'):