#31082: New `Content-Disposition: inline` header in FileResponse causing issues
on
Safari
-------------------------------+--------------------------------------
Reporter: David Evans | Owner: nobody
Type: Bug | Status: closed
Component: HTTP handling | Version: 3.0
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Carlton Gibson):
* status: new => closed
* resolution: => invalid
* type: Uncategorized => Bug
Comment:
Hi David.
Thank you for opening the issue here. Very interesting.
I'm going to initially close this as Invalid, but happy to continue
discussion. (!!!)
Summary: I think Whitenoise should be passing the filename parameter to
`FileReponse`, with the original filename, maybe with the checksum
component, but definitely with the original `.js` extension, rather than
the `.gz` extension that gets added during the collect static phase.
Note [https://docs.djangoproject.com/en/3.0/ref/request-response
/#fileresponse-objects the `FileResponse` docs]:
> If open_file doesn’t have a name or if the name of open_file isn’t
appropriate, provide a custom file name using the filename parameter.
Doing this, results in Safari loading the page correctly. i.e. it's not
the `filename` parameter causing the issue, but the `.gz`, which I'm
guessing Safari takes as invalid for JS...?
(With the original filename in place, Safari still picks up the content
encoding as gzip and loads the file correctly.)
What do you think? C.
--
Ticket URL: <https://code.djangoproject.com/ticket/31082#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/064.0ac97fb9b35b6369185adfe27c2c0385%40djangoproject.com.