diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2024-11-25 11:35:49 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-25 19:35:49 +0000 |
commit | 703be6bf307ed19ce8dc8cd311d24aeb6e5b9861 (patch) | |
tree | d688ea0f3db339ab9ca89ef15399419e8c31899a /routers/api/v1/api.go | |
parent | 44909f6e2c8f94b3153cb5114078e4eebe65a4a8 (diff) | |
download | gitea-703be6bf307ed19ce8dc8cd311d24aeb6e5b9861.tar.gz gitea-703be6bf307ed19ce8dc8cd311d24aeb6e5b9861.zip |
Add github compatible tarball download API endpoints (#32572)
Fix #29654
Fix #32481
Diffstat (limited to 'routers/api/v1/api.go')
-rw-r--r-- | routers/api/v1/api.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go index 23f466873b..0079e8dc87 100644 --- a/routers/api/v1/api.go +++ b/routers/api/v1/api.go @@ -1377,6 +1377,8 @@ func Routes() *web.Router { m.Post("", bind(api.UpdateRepoAvatarOption{}), repo.UpdateAvatar) m.Delete("", repo.DeleteAvatar) }, reqAdmin(), reqToken()) + + m.Get("/{ball_type:tarball|zipball|bundle}/*", reqRepoReader(unit.TypeCode), repo.DownloadArchive) }, repoAssignment(), checkTokenPublicOnly()) }, tokenRequiresScopes(auth_model.AccessTokenScopeCategoryRepository)) |