Skip to content

Commit 56e722f

Browse files
authored
Require token for GET subscription endpoint (go-gitea#28765) (go-gitea#28778)
Backport go-gitea#28765 for 1.21
1 parent 80e5640 commit 56e722f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/integration/api_user_watch_test.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,10 @@ func TestAPIWatch(t *testing.T) {
6363
t.Run("IsWatching", func(t *testing.T) {
6464
defer tests.PrintCurrentTest(t)()
6565

66-
req := NewRequest(t, "GET", fmt.Sprintf("/api/v1/repos/%s/subscription?token=%s", repo, tokenWithRepoScope))
66+
req := NewRequest(t, "GET", fmt.Sprintf("/api/v1/repos/%s/subscription", repo))
67+
MakeRequest(t, req, http.StatusUnauthorized)
68+
69+
req = NewRequest(t, "GET", fmt.Sprintf("/api/v1/repos/%s/subscription?token=%s", repo, tokenWithRepoScope))
6770
MakeRequest(t, req, http.StatusOK)
6871

6972
req = NewRequest(t, "GET", fmt.Sprintf("/api/v1/repos/%s/subscription?token=%s", repo+"notexisting", tokenWithRepoScope))

0 commit comments

Comments
 (0)