aboutsummaryrefslogtreecommitdiffstats
path: root/tests/integration/change_default_branch_test.go
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2024-10-10 11:48:21 +0800
committerGitHub <noreply@github.com>2024-10-10 03:48:21 +0000
commitdd83cfcacc989d0e7cbd21ec5eba029fdfcb72dd (patch)
treef2d23e3e6e8a1f010593bafe94f42081a7b2a4cb /tests/integration/change_default_branch_test.go
parent368b0881f502dd36a1ae725493c85683803fd816 (diff)
downloadgitea-dd83cfcacc989d0e7cbd21ec5eba029fdfcb72dd.tar.gz
gitea-dd83cfcacc989d0e7cbd21ec5eba029fdfcb72dd.zip
Refactor CSRF token (#32216)
Diffstat (limited to 'tests/integration/change_default_branch_test.go')
-rw-r--r--tests/integration/change_default_branch_test.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/integration/change_default_branch_test.go b/tests/integration/change_default_branch_test.go
index 703834b712..729eb1e4ce 100644
--- a/tests/integration/change_default_branch_test.go
+++ b/tests/integration/change_default_branch_test.go
@@ -22,7 +22,7 @@ func TestChangeDefaultBranch(t *testing.T) {
session := loginUser(t, owner.Name)
branchesURL := fmt.Sprintf("/%s/%s/settings/branches", owner.Name, repo.Name)
- csrf := GetCSRF(t, session, branchesURL)
+ csrf := GetUserCSRFToken(t, session)
req := NewRequestWithValues(t, "POST", branchesURL, map[string]string{
"_csrf": csrf,
"action": "default_branch",
@@ -30,7 +30,7 @@ func TestChangeDefaultBranch(t *testing.T) {
})
session.MakeRequest(t, req, http.StatusSeeOther)
- csrf = GetCSRF(t, session, branchesURL)
+ csrf = GetUserCSRFToken(t, session)
req = NewRequestWithValues(t, "POST", branchesURL, map[string]string{
"_csrf": csrf,
"action": "default_branch",