summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorGiteabot <teabot@gitea.io>2024-01-12 14:51:27 +0800
committerGitHub <noreply@github.com>2024-01-12 14:51:27 +0800
commitcb33623bb6b0cf60417c4a1d84b8f42ef1714ea3 (patch)
treec29a1533e9b13a428cd47c34d902cdfa2914b482 /routers
parent9f0c709637c30241224784a7c5e0f376c6b958ef (diff)
downloadgitea-cb33623bb6b0cf60417c4a1d84b8f42ef1714ea3.tar.gz
gitea-cb33623bb6b0cf60417c4a1d84b8f42ef1714ea3.zip
Require token for GET subscription endpoint (#28765) (#28768)
Backport #28765 by @jackHay22 Fixes #28756 ## Changes - Require and check API token for `GET /repos/{owner}/{repo}/subscription` in order to populate `ctx.Doer`. Co-authored-by: Jack Hay <jack@allspice.io>
Diffstat (limited to 'routers')
-rw-r--r--routers/api/v1/api.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go
index 09fde1e05b..8dba0a7908 100644
--- a/routers/api/v1/api.go
+++ b/routers/api/v1/api.go
@@ -1143,9 +1143,9 @@ func Routes() *web.Route {
m.Get("/subscribers", repo.ListSubscribers)
m.Group("/subscription", func() {
m.Get("", user.IsWatching)
- m.Put("", reqToken(), user.Watch)
- m.Delete("", reqToken(), user.Unwatch)
- })
+ m.Put("", user.Watch)
+ m.Delete("", user.Unwatch)
+ }, reqToken())
m.Group("/releases", func() {
m.Combo("").Get(repo.ListReleases).
Post(reqToken(), reqRepoWriter(unit.TypeReleases), context.ReferencesGitRepo(), bind(api.CreateReleaseOption{}), repo.CreateRelease)