mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-07 21:43:23 +09:00
enhance(repo): check full repo name for dangerous operations (#39213)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@@ -388,7 +388,7 @@ func testForkToEditFile(t *testing.T, session *TestSession, user, owner, repo, b
|
||||
// Archive the repository
|
||||
req := NewRequestWithValues(t, "POST", "/"+path.Join(user, repo, "settings"),
|
||||
map[string]string{
|
||||
"repo_name": repo,
|
||||
"repo_name": user + "/" + repo,
|
||||
"action": "archive",
|
||||
},
|
||||
)
|
||||
@@ -402,7 +402,7 @@ func testForkToEditFile(t *testing.T, session *TestSession, user, owner, repo, b
|
||||
// Unfork the repository
|
||||
req = NewRequestWithValues(t, "POST", "/"+path.Join(user, repo, "settings"),
|
||||
map[string]string{
|
||||
"repo_name": repo,
|
||||
"repo_name": user + "/" + repo,
|
||||
"action": "convert_fork",
|
||||
},
|
||||
)
|
||||
|
||||
@@ -187,7 +187,7 @@ func testUIDeleteBranch(t *testing.T, session *TestSession, ownerName, repoName,
|
||||
func testDeleteRepository(t *testing.T, session *TestSession, ownerName, repoName string) {
|
||||
relURL := "/" + path.Join(ownerName, repoName, "settings")
|
||||
req := NewRequestWithValues(t, "POST", relURL+"?action=delete", map[string]string{
|
||||
"repo_name": repoName,
|
||||
"repo_name": ownerName + "/" + repoName,
|
||||
})
|
||||
resp := session.MakeRequest(t, req, http.StatusOK)
|
||||
assert.NotNil(t, test.ParseJSONRedirect(resp.Body.Bytes()).Redirect)
|
||||
|
||||
Reference in New Issue
Block a user