Author: mtredinnick
Date: 2007-10-20 01:50:16 -0500 (Sat, 20 Oct 2007)
New Revision: 6548
Modified:
django/trunk/django/http/__init__.py
Log:
Fixed #4969 -- Changed content retrieval in HttpResponse to be more robust in
the presence of an existing content encoding. Fixes some sporadic failures with
the GzipMiddleware, for example. Thanks, Johann Queuniet.
Modified: django/trunk/django/http/__init__.py
===================================================================
--- django/trunk/django/http/__init__.py 2007-10-20 06:30:44 UTC (rev
6547)
+++ django/trunk/django/http/__init__.py 2007-10-20 06:50:16 UTC (rev
6548)
@@ -317,8 +317,9 @@
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]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---