Skip to content

Commit 7c2f093

Browse files
authored
Require token for GET subscription endpoint (#28765)
Fixes #28756 ## Changes - Require and check API token for `GET /repos/{owner}/{repo}/subscription` in order to populate `ctx.Doer`.
1 parent 595a929 commit 7c2f093

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

routers/api/v1/api.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -1156,9 +1156,9 @@ func Routes() *web.Route {
11561156
m.Get("/subscribers", repo.ListSubscribers)
11571157
m.Group("/subscription", func() {
11581158
m.Get("", user.IsWatching)
1159-
m.Put("", reqToken(), user.Watch)
1160-
m.Delete("", reqToken(), user.Unwatch)
1161-
})
1159+
m.Put("", user.Watch)
1160+
m.Delete("", user.Unwatch)
1161+
}, reqToken())
11621162
m.Group("/releases", func() {
11631163
m.Combo("").Get(repo.ListReleases).
11641164
Post(reqToken(), reqRepoWriter(unit.TypeReleases), context.ReferencesGitRepo(), bind(api.CreateReleaseOption{}), repo.CreateRelease)

0 commit comments

Comments
 (0)