-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Content-Disposition header for binary downloads #702
Comments
From @xxyy in Gitter:
|
It seems that the header was initially added in this commit, which sadly doesn't provide context as to why it was. It's not mentioned in the changelog either. As @Jotschi mentioned on Gitter, it would probably make sense to align the behaviour to common web servers. Looking at the Google results for e.g. Apache, the only things that pop up are how to make it add the header. Also, in the current version of the (main) source, the only mentions of the header are for form data. Similar results for nginx and IIS. Hence, it seems like major web servers don't handle/send the header at all by default. With this, not sending it might be a sensible default behaviour, but it really depends on which use-case caused it to be added in the first place. Since, for the binary download request, there are already some query parameters, and controlling responses via query parameters seems to match the general spirit of the REST API, adding the query parameter switch seems like the best option to me, given what I know about the context, and also respecting that some people might already be depending on the existing behaviour. |
The one more cause do something with
|
Suggested change for content-disposition header was released in 0.35.0. I'll keep the issue open since I want to address the Content-Disposition behavior separately. |
Why not change content-disposition: attachment; filename="filename.pdf" to content-disposition: inline; filename="filename.pdf" |
Currently every binary download response has the
Content-Disposition
header set to attachment, forcing the browser to download the file when linked directly. Some times it makes more sense to let the file be viewed directly in the browser.Here are some suggestions:
<a>
tag to make the browser download the link (https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#Attributes). This does not work cross-origin.The text was updated successfully, but these errors were encountered: