diff options
author | silverwind <me@silverwind.io> | 2022-07-30 18:37:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-30 18:37:02 +0200 |
commit | eeb490c7ab11cb6895ddf6e3069a2397c81296c9 (patch) | |
tree | 661e4692c87f5c560016c505507a09ec0a280ada /models/publickey.go | |
parent | 97a8c96c5b45123f580244edbc9b2ad3e102b6ee (diff) | |
download | gitea-eeb490c7ab11cb6895ddf6e3069a2397c81296c9.tar.gz gitea-eeb490c7ab11cb6895ddf6e3069a2397c81296c9.zip |
Rework raw file http header logic (#20484) (#20542)
- Always respect the user's configured mime type map
- Allow more types like image/pdf/video/audio to serve with correct content-type
- Shorten cache duration of raw files to 5 minutes, matching GitHub
- Don't set `content-disposition: attachment`, let the browser decide whether it wants to download or display a file directly
- Implement rfc5987 for filenames, remove previous hack. Confirmed it working in Safari.
- Make PDF attachment work in Safari by removing `sandbox` attribute.
This change will make a lot more file types open directly in browser now. Logic should generally be more readable than before with less `if` nesting and such.
Replaces: https://github.com/go-gitea/gitea/pull/20460
Replaces: https://github.com/go-gitea/gitea/pull/20455
Fixes: https://github.com/go-gitea/gitea/issues/20404
Diffstat (limited to 'models/publickey.go')
0 files changed, 0 insertions, 0 deletions