aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJack Hay <jack@allspice.io>2024-01-12 21:01:15 -0500
committerGitHub <noreply@github.com>2024-01-13 02:01:15 +0000
commit56e722f825afacfa88a814d16ac200c7bfa06f91 (patch)
tree5aad04171ed10652bfd2e2d23e052ac11d06b8ca /tests
parent80e564087dc1a89b8b74abcdc879c2de444d3278 (diff)
downloadgitea-56e722f825afacfa88a814d16ac200c7bfa06f91.tar.gz
gitea-56e722f825afacfa88a814d16ac200c7bfa06f91.zip
Require token for GET subscription endpoint (#28765) (#28778)
Backport #28765 for 1.21
Diffstat (limited to 'tests')
-rw-r--r--tests/integration/api_user_watch_test.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/integration/api_user_watch_test.go b/tests/integration/api_user_watch_test.go
index c07fd288d1..f734d3edcc 100644
--- a/tests/integration/api_user_watch_test.go
+++ b/tests/integration/api_user_watch_test.go
@@ -63,7 +63,10 @@ func TestAPIWatch(t *testing.T) {
t.Run("IsWatching", func(t *testing.T) {
defer tests.PrintCurrentTest(t)()
- req := NewRequest(t, "GET", fmt.Sprintf("/api/v1/repos/%s/subscription?token=%s", repo, tokenWithRepoScope))
+ req := NewRequest(t, "GET", fmt.Sprintf("/api/v1/repos/%s/subscription", repo))
+ MakeRequest(t, req, http.StatusUnauthorized)
+
+ req = NewRequest(t, "GET", fmt.Sprintf("/api/v1/repos/%s/subscription?token=%s", repo, tokenWithRepoScope))
MakeRequest(t, req, http.StatusOK)
req = NewRequest(t, "GET", fmt.Sprintf("/api/v1/repos/%s/subscription?token=%s", repo+"notexisting", tokenWithRepoScope))