1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #333 and #440 -- Split DEFAULT_MIME_TYPE setting into DEFAULT_CONTENT_TYPE and DEFAULT_CHARSET. Thanks, Maniac.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@786 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty
2005-10-06 02:27:08 +00:00
parent 261ab166ce
commit ab9aacd4db
9 changed files with 22 additions and 16 deletions

View File

@@ -76,7 +76,7 @@ class CacheMiddleware:
Sets the cache, if needed.
"""
if request._cache_middleware_set_cache:
content = response.get_content_as_string('utf-8')
content = response.get_content_as_string(settings.DEFAULT_CHARSET)
if request._cache_middleware_accepts_gzip:
content = compress_string(content)
response.content = content

View File

@@ -76,7 +76,7 @@ class CommonMiddleware:
# Use ETags, if requested.
if settings.USE_ETAGS:
etag = md5.new(response.get_content_as_string('utf-8')).hexdigest()
etag = md5.new(response.get_content_as_string(settings.DEFAULT_CHARSET)).hexdigest()
if request.META.get('HTTP_IF_NONE_MATCH') == etag:
response = httpwrappers.HttpResponseNotModified()
else: