-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Workaround breaking change in Django 3.0
Django 3.0 adds a default Content-Disposition header to all FileResponse instances. Where the response isn't flagged as an attachment this header has the form `inline; filename="<filename>"`. See: https://code.djangoproject.com/ticket/30196 This header causes problems with Safari (see #240 and #241) so we want to make sure we don't send it. Looking at the code for FileResponse I can see that Django is also setting other default headers. These will generally be overwritten by WhiteNoise, but they cause unnecessary file accesses and provide more possibilities for errors. This patch creates a tiny wrapper around FileResponse which disables the setting of any default headers.
- Loading branch information
Showing
2 changed files
with
29 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters