gitea/modules
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
..
activitypub Add more linters to improve code readability (#19989) 2022-06-20 12:02:49 +02:00
analyze Simplify `IsVendor` (#19626) 2022-05-06 10:12:30 +01:00
appstate
auth Remove legacy `+build:` constraint (#19582) 2022-05-02 23:22:45 +08:00
avatar Remove legacy `+build:` constraint (#19582) 2022-05-02 23:22:45 +08:00
base Add more linters to improve code readability (#19989) 2022-06-20 12:02:49 +02:00
cache Update go-chi/cache to utilize Ping() (#19719) 2022-05-15 20:43:27 +02:00
charset Fix various typos (#20338) 2022-07-12 23:32:37 +02:00
container
context Extended permission checks. (#20517) 2022-07-28 21:04:03 +08:00
convert Include login_name in adminCreateUser response (#20283) 2022-07-15 16:52:11 +08:00
csv Allow render HTML with css/js external links (#19017) 2022-06-16 11:33:23 +08:00
doctor Fix various typos (#20338) 2022-07-12 23:32:37 +02:00
emoji
eventsource Add more linters to improve code readability (#19989) 2022-06-20 12:02:49 +02:00
generate
git Slightly simplify LastCommitCache (#20444) 2022-07-25 16:39:42 +01:00
gitgraph Add more linters to improve code readability (#19989) 2022-06-20 12:02:49 +02:00
graceful Add more linters to improve code readability (#19989) 2022-06-20 12:02:49 +02:00
hcaptcha
highlight Improve code diff highlight, fix incorrect rendered diff result (#19958) 2022-07-23 19:28:02 +08:00
hostmatcher Add tests for the host checking logic, clarify the behaviors (#20328) 2022-07-13 09:07:16 +08:00
httpcache Add Cache-Control header to html and api responses, add no-transform (#20432) 2022-07-23 14:38:03 +08:00
httplib
indexer Fix `dump-repo` git init, fix wrong error type for NullDownloader (#20182) 2022-07-01 07:48:25 +08:00
json
lfs Removed some vestigial code related to Range bounds checks (#20312) 2022-07-28 11:04:36 +08:00
log Empty log queue on flush and close (#19994) 2022-06-18 10:33:13 +08:00
markup Use body text color in repository files table links (#20386) 2022-07-22 18:49:24 +08:00
metrics
migration Fix `dump-repo` git init, fix wrong error type for NullDownloader (#20182) 2022-07-01 07:48:25 +08:00
mirror Implement sync push mirror on commit (#19411) 2022-07-08 20:45:12 +01:00
nosql Fix various typos (#20338) 2022-07-12 23:32:37 +02:00
notification Added email notification option to receive all own messages (#20179) 2022-07-28 16:30:12 +08:00
options Remove legacy `+build:` constraint (#19582) 2022-05-02 23:22:45 +08:00
packages Add Docker /v2/_catalog endpoint (#20469) 2022-07-28 11:59:39 +08:00
paginator
password
pprof
private Allow manager logging to set SQL (#20064) 2022-06-24 12:49:47 +02:00
process Add more linters to improve code readability (#19989) 2022-06-20 12:02:49 +02:00
proxy
public Remove legacy `+build:` constraint (#19582) 2022-05-02 23:22:45 +08:00
queue Add more linters to improve code readability (#19989) 2022-06-20 12:02:49 +02:00
recaptcha
references Add more linters to improve code readability (#19989) 2022-06-20 12:02:49 +02:00
regexplru Custom regexp external issues (#17624) 2022-06-10 13:39:53 +08:00
repository Adjust transaction handling via db.Context (#20031) 2022-06-20 14:38:58 +02:00
secret
session
setting Use default values when provided values are empty (#20318) 2022-07-13 13:33:31 +08:00
sitemap Add sitemap support (#18407) 2022-06-25 19:06:01 +02:00
ssh Stop logging EOFs and exit(1)s in ssh handler (#20476) 2022-07-28 20:56:55 +01:00
storage Add more linters to improve code readability (#19989) 2022-06-20 12:02:49 +02:00
structs Dismiss prior pull reviews if done via web in review dismiss (#20197) 2022-07-19 15:20:28 +02:00
svg Remove legacy `+build:` constraint (#19582) 2022-05-02 23:22:45 +08:00
sync
templates Vertical align avatar at middle (#20302) 2022-07-10 19:49:13 +01:00
test Move access and repo permission to models/perm/access (#19350) 2022-05-11 12:09:36 +02:00
timeutil Make better use of i18n (#20096) 2022-06-26 22:19:22 +08:00
translation Allow dev i18n to be more concurrent (#20159) 2022-07-04 12:17:09 +02:00
typesniffer Rework raw file http header logic (#20484) 2022-07-29 17:26:55 +02:00
updatechecker
upload
uri
user
util Add more linters to improve code readability (#19989) 2022-06-20 12:02:49 +02:00
validation
web Fix various typos (#20338) 2022-07-12 23:32:37 +02:00