silverwind eaf653f843
Rework raw file http header logic (#20484)
- 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-29 17:26:55 +02:00
..
2022-05-06 10:12:30 +01:00
2022-07-12 23:32:37 +02:00
2022-07-12 23:32:37 +02:00
2022-01-20 18:46:10 +01:00
2020-10-02 23:37:53 -04:00
2022-01-19 19:31:39 -05:00
2022-01-20 18:46:10 +01:00
2022-07-12 23:32:37 +02:00
2022-01-20 18:46:10 +01:00
2022-06-25 19:06:01 +02:00
2022-06-26 22:19:22 +08:00
2021-12-20 04:41:31 +00:00
2020-04-05 07:20:50 +01:00
2022-04-25 13:55:12 +08:00
2022-07-12 23:32:37 +02:00