Ticket #2946: django-http-mimetype.diff
File django-http-mimetype.diff, 743 bytes (added by , 18 years ago) |
---|
-
django/http/__init__.py
159 159 from django.conf import settings 160 160 self._charset = settings.DEFAULT_CHARSET 161 161 if not mimetype: 162 mimetype = "%s; charset=%s" % (settings.DEFAULT_CONTENT_TYPE, settings.DEFAULT_CHARSET) 162 mimetype = settings.DEFAULT_CONTENT_TYPE 163 if mimetype.startswith('text/') and not 'charset=' in mimetype: 164 mimetype = "%s; charset=%s" % (mimetype, settings.DEFAULT_CHARSET) 163 165 if hasattr(content, '__iter__'): 164 166 self._container = content 165 167 self._is_string = False