1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #33567 -- Avoided setting default text/html content type on responses.

This commit is contained in:
Claude Paroz
2022-03-08 17:03:04 +01:00
committed by Carlton Gibson
parent 3dbf46654c
commit 93803a1b5f
6 changed files with 11 additions and 14 deletions

View File

@@ -101,8 +101,10 @@ class FileResponseTests(SimpleTestCase):
self.assertEqual(response.headers["Content-Type"], "video/webm")
def test_content_type_buffer_explicit_default(self):
response = FileResponse(io.BytesIO(b"binary content"), content_type="text/html")
self.assertEqual(response.headers["Content-Type"], "text/html")
response = FileResponse(
io.BytesIO(b"binary content"), content_type="text/html; charset=utf-8"
)
self.assertEqual(response.headers["Content-Type"], "text/html; charset=utf-8")
def test_content_type_buffer_named(self):
test_tuples = (