Revision 6b256427 snf-django-lib/snf_django/lib/api/__init__.py
b/snf-django-lib/snf_django/lib/api/__init__.py | ||
---|---|---|
190 | 190 |
response["Date"] = format_date_time(time()) |
191 | 191 |
|
192 | 192 |
if not response.has_header("Content-Length"): |
193 |
# compatibility code for django 1.4 |
|
194 |
_is_string = getattr(response, '_is_string', None) # Django==1.2 |
|
195 | 193 |
_base_content_is_iter = getattr(response, '_base_content_is_iter', |
196 | 194 |
None) |
197 |
if (_is_string is not None and _is_string) or\ |
|
198 |
(_base_content_is_iter is not None and |
|
199 |
not _base_content_is_iter): |
|
195 |
if (_base_content_is_iter is not None and not _base_content_is_iter): |
|
200 | 196 |
response["Content-Length"] = len(response.content) |
201 | 197 |
else: |
202 | 198 |
if not (response.has_header('Content-Type') and |
Also available in: Unified diff