Commit 5a0aa275 authored by Christos Stavrakakis's avatar Christos Stavrakakis
Browse files

wheezy: HttpResponse has no _is_string attribute

parent 9a8b7b9d
......@@ -189,7 +189,12 @@ def update_response_headers(request, response):
response["Date"] = format_date_time(time())
if not response.has_header("Content-Length"):
if response._is_string:
_is_string = getattr(response, '_is_string', None) # Django==1.2
_base_content_is_iter = getattr(response, '_base_content_is_iter',
None)
if (_is_string is not None and _is_string) or\
(_base_content_is_iter is not None and
not _base_content_is_iter):
response["Content-Length"] = len(response.content)
else:
if not (response.has_header('Content-Type') and
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment