forgejo/models
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
..
actions Treat PRs with agit flow as fork PRs when triggering actions. (#23884) 2023-04-06 16:57:30 -04:00
activities Add activity feeds API (#23494) 2023-04-04 21:35:31 +08:00
admin
asymkey Prefer native parser for SSH public key parsing (#23798) 2023-04-11 14:34:28 +08:00
auth Fix 500 error if there is a name conflict when edit authentication source (#23832) 2023-03-31 22:32:18 +08:00
avatars
db
dbfs
fixtures Support "." char as user name for User/Orgs in RSS/ATOM/GPG/KEYS path ... (#23874) 2023-04-07 18:08:36 +08:00
git Fix branch protection priority (#24045) 2023-04-11 13:22:49 -04:00
issues Localize milestone related time strings (#24051) 2023-04-12 02:29:49 -04:00
migrations Fix owner team access mode value in team_unit table (#23675) 2023-04-03 10:36:35 -04:00
organization Allow repo admins too to delete the repo (#23940) 2023-04-07 11:21:02 -04:00
packages Use ghost user if package creator does not exist (#23822) 2023-04-04 16:14:46 +08:00
perm
project Improve GetBoards and getDefaultBoard (#22981) 2023-04-09 22:07:23 +08:00
pull
repo Make Release Download URLs predictable (#23891) 2023-04-12 17:05:23 +08:00
secret
system
unit Improve LoadUnitConfig to handle invalid or duplicate units (#23736) 2023-04-03 16:42:38 +08:00
unittest
user Reserve ".png" suffix for user/org names (#23992) 2023-04-10 16:14:16 -04:00
webhook
error.go
fixture_generation.go
fixture_test.go
main_test.go
migrate.go
migrate_test.go
org.go
org_team.go
org_team_test.go
org_test.go
repo.go
repo_collaboration.go
repo_collaboration_test.go
repo_test.go
repo_transfer.go
repo_transfer_test.go