diff options
author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2023-03-14 05:45:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-14 05:45:30 +0100 |
commit | 254ad2e3450d8175170914f06af8358d2becc35b (patch) | |
tree | 89aabc82fb316ea50bc79354a9c4aba233ebdf0a /django | |
parent | fbe850106b2e4b85f838219cb9e1df95fba6c164 (diff) | |
download | django-254ad2e3450d8175170914f06af8358d2becc35b.tar.gz |
Fixed #34405 -- Fixed setting Content-Type header in FileResponse for compress and brotli.
Thanks Chamal De Silva for the report.
Diffstat (limited to 'django')
-rw-r--r-- | django/http/response.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/django/http/response.py b/django/http/response.py index f62dec8ce9..3b611e78f5 100644 --- a/django/http/response.py +++ b/django/http/response.py @@ -609,7 +609,9 @@ class FileResponse(StreamingHttpResponse): # Encoding isn't set to prevent browsers from automatically # uncompressing files. content_type = { + "br": "application/x-brotli", "bzip2": "application/x-bzip", + "compress": "application/x-compress", "gzip": "application/gzip", "xz": "application/x-xz", }.get(encoding, content_type) |