forked from forgejo/forgejo
Update HTTP status codes to modern codes (#18063)
* 2xx/3xx/4xx/5xx -> http.Status... * http.StatusFound -> http.StatusTemporaryRedirect * http.StatusMovedPermanently -> http.StatusPermanentRedirect
This commit is contained in:
parent
395117d301
commit
3f280f89e7
76 changed files with 211 additions and 212 deletions
|
@ -34,7 +34,7 @@ func TestCreateFile(t *testing.T) {
|
|||
"content": "Content",
|
||||
"commit_choice": "direct",
|
||||
})
|
||||
session.MakeRequest(t, req, http.StatusFound)
|
||||
session.MakeRequest(t, req, http.StatusSeeOther)
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -48,7 +48,7 @@ func TestCreateFileOnProtectedBranch(t *testing.T) {
|
|||
"_csrf": csrf,
|
||||
"protected": "on",
|
||||
})
|
||||
session.MakeRequest(t, req, http.StatusFound)
|
||||
session.MakeRequest(t, req, http.StatusSeeOther)
|
||||
// Check if master branch has been locked successfully
|
||||
flashCookie := session.GetCookie("macaron_flash")
|
||||
assert.NotNil(t, flashCookie)
|
||||
|
@ -82,7 +82,7 @@ func TestCreateFileOnProtectedBranch(t *testing.T) {
|
|||
"_csrf": csrf,
|
||||
"protected": "off",
|
||||
})
|
||||
resp = session.MakeRequest(t, req, http.StatusFound)
|
||||
resp = session.MakeRequest(t, req, http.StatusSeeOther)
|
||||
// Check if master branch has been locked successfully
|
||||
flashCookie = session.GetCookie("macaron_flash")
|
||||
assert.NotNil(t, flashCookie)
|
||||
|
@ -109,7 +109,7 @@ func testEditFile(t *testing.T, session *TestSession, user, repo, branch, filePa
|
|||
"commit_choice": "direct",
|
||||
},
|
||||
)
|
||||
resp = session.MakeRequest(t, req, http.StatusFound)
|
||||
resp = session.MakeRequest(t, req, http.StatusSeeOther)
|
||||
|
||||
// Verify the change
|
||||
req = NewRequest(t, "GET", path.Join(user, repo, "raw/branch", branch, filePath))
|
||||
|
@ -139,7 +139,7 @@ func testEditFileToNewBranch(t *testing.T, session *TestSession, user, repo, bra
|
|||
"new_branch_name": targetBranch,
|
||||
},
|
||||
)
|
||||
resp = session.MakeRequest(t, req, http.StatusFound)
|
||||
resp = session.MakeRequest(t, req, http.StatusSeeOther)
|
||||
|
||||
// Verify the change
|
||||
req = NewRequest(t, "GET", path.Join(user, repo, "raw/branch", targetBranch, filePath))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue