gitea/models/repo
JakobDev 42919ccb7c
Make Release Download URLs predictable (#23891)
As promised in #23817, I have this made a PR to make Release Download
URLs predictable. It currently follows the schema
`<repo>/releases/download/<tag>/<filename>`. this already works, but it
is nowhere shown in the UI or the API. The Problem is, that it is
currently possible to have multiple files with the same name (why do we
even allow this) for a release. I had written some Code to check, if a
Release has 2 or more files with the same Name. If yes, it uses the old
`attachments/<uuid>` URlL if no it uses the new fancy URL.

I had also changed `<repo>/releases/download/<tag>/<filename>` to
directly serve the File instead of redirecting, so people who who use
automatic update checker don't end up with the `attachments/<uuid>` URL.

Fixes #10919

---------

Co-authored-by: a1012112796 <1012112796@qq.com>
2023-04-12 17:05:23 +08:00
..
archiver.go
attachment_test.go
attachment.go Make Release Download URLs predictable (#23891) 2023-04-12 17:05:23 +08:00
avatar.go Add context cache as a request level cache (#22294) 2023-02-15 21:37:34 +08:00
collaboration_test.go
collaboration.go
fork_test.go
fork.go
git.go
issue.go
language_stats.go
main_test.go
mirror.go
pushmirror_test.go
pushmirror.go
redirect_test.go
redirect.go
release.go Make Release Download URLs predictable (#23891) 2023-04-12 17:05:23 +08:00
repo_indexer.go
repo_list_test.go
repo_list.go Use context for RepositoryList.LoadAttributes (#23435) 2023-03-13 11:31:41 +00:00
repo_test.go Set repository link based on the url in package.json for npm packages (#20379) 2023-03-28 13:55:03 -04:00
repo_unit.go Pull Requests: setting to allow edits by maintainers by default, tweak UI (#22862) 2023-02-13 14:09:52 +08:00
repo.go Set repository link based on the url in package.json for npm packages (#20379) 2023-03-28 13:55:03 -04:00
star_test.go
star.go
topic_test.go
topic.go
update.go Rename repo.GetOwner to repo.LoadOwner (#22967) 2023-02-18 20:11:03 +08:00
upload.go
user_repo_test.go
user_repo.go Refactor authors dropdown (send get request from frontend to avoid long wait time) (#23890) 2023-04-07 08:11:02 +08:00
watch_test.go
watch.go
wiki_test.go
wiki.go