Skip to content

Commit 8da1a0e

Browse files
jackHay22GiteaBot
authored andcommitted
Require token for GET subscription endpoint (go-gitea#28765)
Fixes go-gitea#28756 ## Changes - Require and check API token for `GET /repos/{owner}/{repo}/subscription` in order to populate `ctx.Doer`.
1 parent 9f0c709 commit 8da1a0e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

routers/api/v1/api.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,9 +1143,9 @@ func Routes() *web.Route {
11431143
m.Get("/subscribers", repo.ListSubscribers)
11441144
m.Group("/subscription", func() {
11451145
m.Get("", user.IsWatching)
1146-
m.Put("", reqToken(), user.Watch)
1147-
m.Delete("", reqToken(), user.Unwatch)
1148-
})
1146+
m.Put("", user.Watch)
1147+
m.Delete("", user.Unwatch)
1148+
}, reqToken())
11491149
m.Group("/releases", func() {
11501150
m.Combo("").Get(repo.ListReleases).
11511151
Post(reqToken(), reqRepoWriter(unit.TypeReleases), context.ReferencesGitRepo(), bind(api.CreateReleaseOption{}), repo.CreateRelease)

0 commit comments

Comments
 (0)