Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #4969 -- Changed content retrieval in HttpResponse to be more r…

…obust in

the presence of an existing content encoding. Fixes some sporadic failures with
the GzipMiddleware, for example. Thanks, Johann Queuniet.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6548 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 570e8936d9aaf217ef61d9b46fb9f5361f013c28 1 parent aa32070
Malcolm Tredinnick malcolmt authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 django/http/__init__.py
5 django/http/__init__.py
View
@@ -317,8 +317,9 @@ def delete_cookie(self, key, path='/', domain=None):
self.cookies[key]['max-age'] = 0
def _get_content(self):
- content = smart_str(''.join(self._container), self._charset)
- return content
+ if self.has_header('Content-Encoding'):
+ return ''.join(self._container)
+ return smart_str(''.join(self._container), self._charset)
def _set_content(self, value):
self._container = [value]
Please sign in to comment.
Something went wrong with that request. Please try again.