gentics / gentics/mesh

Content-Disposition header for binary downloads

Open
#702 5 comments 2 reactions 0 assignees View on GitHub
enhancement f/rest
Dominant language
Java
Stars
593
Forks
123
Avg merge
2d 18h
Merged PRs (30d)
4

Description

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:
* Remove the header and use the download attribute of the `` 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.
* Make the header inline for some hard coded content types (what you suggested)
* Make the headers somehow configurable - for some projects it makes sense to download a pdf file, for others it makes more sense to have it inline.

Contributor guide

Open the contributing guide

Research direction

Start with the issue's three proposed approaches and review the five-comment discussion to determine which behavior is intended for binary download responses. Done means an agreed Content-Disposition behavior is implemented and its browser, cross-origin, and configurability expectations are verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.