forgejo/routers
silverwind eeb490c7ab
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
2022-07-30 18:37:02 +02:00
..
api Add Docker /v2/_catalog endpoint (#20469) (#20556) 2022-07-30 17:52:04 +02:00
common Rework raw file http header logic (#20484) (#20542) 2022-07-30 18:37:02 +02:00
install Add Cache-Control header to html and api responses, add no-transform (#20432) (#20459) 2022-07-23 11:58:58 +01:00
private move agit dependcy (#19998) 2022-06-17 20:17:12 +02:00
utils A better go code formatter, and now make fmt can run in Windows (#17684) 2021-11-17 20:34:35 +08:00
web Add Docker /v2/_catalog endpoint (#20469) (#20556) 2022-07-30 17:52:04 +02:00
init.go Initialize cron last (#20373) (#20384) 2022-07-15 13:44:22 -04:00