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:
KN4CK3R 2022-03-23 05:54:07 +01:00 committed by GitHub
parent 395117d301
commit 3f280f89e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
76 changed files with 211 additions and 212 deletions

View file

@ -42,7 +42,7 @@ func testPullMerge(t *testing.T, session *TestSession, user, repo, pullnum strin
"_csrf": htmlDoc.GetCSRF(),
"do": string(mergeStyle),
})
resp = session.MakeRequest(t, req, http.StatusFound)
resp = session.MakeRequest(t, req, http.StatusSeeOther)
return resp
}
@ -220,7 +220,7 @@ func TestCantMergeConflict(t *testing.T) {
Base: "base",
Title: "create a conflicting pr",
})
session.MakeRequest(t, req, 201)
session.MakeRequest(t, req, http.StatusCreated)
// Now this PR will be marked conflict - or at least a race will do - so drop down to pure code at this point...
user1 := unittest.AssertExistsAndLoadBean(t, &user_model.User{
@ -330,7 +330,7 @@ func TestCantMergeUnrelated(t *testing.T) {
Base: "base",
Title: "create an unrelated pr",
})
session.MakeRequest(t, req, 201)
session.MakeRequest(t, req, http.StatusCreated)
// Now this PR could be marked conflict - or at least a race may occur - so drop down to pure code at this point...
gitRepo, err := git.OpenRepository(path)