summaryrefslogtreecommitdiff
path: root/django/http
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2018-12-27 19:49:03 -0500
committerTim Graham <timograham@gmail.com>2019-01-17 10:50:25 -0500
commit8045dff98c2533e7e99ce82f80292fc6f3bb7e1f (patch)
treecea0480096b2b285b4664db28b30e3b36db6092e /django/http
parent573ec714e5f52eccde01bbac3836d0edafcb2c20 (diff)
Refs #27829 -- Removed settings.DEFAULT_CONTENT_TYPE per deprecation timeline.
Diffstat (limited to 'django/http')
-rw-r--r--django/http/response.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/django/http/response.py b/django/http/response.py
index f7d248e933..5a640a51cf 100644
--- a/django/http/response.py
+++ b/django/http/response.py
@@ -57,8 +57,7 @@ class HttpResponseBase:
self._reason_phrase = reason
self._charset = charset
if content_type is None:
- content_type = '%s; charset=%s' % (settings.DEFAULT_CONTENT_TYPE,
- self.charset)
+ content_type = 'text/html; charset=%s' % self.charset
self['Content-Type'] = content_type
@property
@@ -427,7 +426,7 @@ class FileResponse(StreamingHttpResponse):
elif hasattr(filelike, 'getbuffer'):
self['Content-Length'] = filelike.getbuffer().nbytes
- if self.get('Content-Type', '').startswith(settings.DEFAULT_CONTENT_TYPE):
+ if self.get('Content-Type', '').startswith('text/html'):
if filename:
content_type, encoding = mimetypes.guess_type(filename)
# Encoding isn't set to prevent browsers from automatically