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:
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user