diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2023-04-14 03:45:33 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-13 15:45:33 -0400 |
commit | 5b9557aef59b190c55de9ea218bf51152bc04786 (patch) | |
tree | d77004c983875886a00acd1561a74b8c3d5ce682 /tests/integration/integration_test.go | |
parent | b7221bec34fd49495234a18c26e4f5d81483e102 (diff) | |
download | gitea-5b9557aef59b190c55de9ea218bf51152bc04786.tar.gz gitea-5b9557aef59b190c55de9ea218bf51152bc04786.zip |
Refactor cookie (#24107)
Close #24062
At the beginning, I just wanted to fix the warning mentioned by #24062
But, the cookie code really doesn't look good to me, so clean up them.
Complete the TODO on `SetCookie`:
> TODO: Copied from gitea.com/macaron/macaron and should be improved
after macaron removed.
Diffstat (limited to 'tests/integration/integration_test.go')
-rw-r--r-- | tests/integration/integration_test.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/integration/integration_test.go b/tests/integration/integration_test.go index 716f6d44ab..965bae576c 100644 --- a/tests/integration/integration_test.go +++ b/tests/integration/integration_test.go @@ -23,6 +23,7 @@ import ( "code.gitea.io/gitea/models/auth" "code.gitea.io/gitea/models/unittest" + gitea_context "code.gitea.io/gitea/modules/context" "code.gitea.io/gitea/modules/graceful" "code.gitea.io/gitea/modules/json" "code.gitea.io/gitea/modules/log" @@ -290,7 +291,7 @@ func getTokenForLoggedInUser(t testing.TB, session *TestSession, scopes ...auth. // Log the flash values on failure if !assert.Equal(t, resp.Result().Header["Location"], []string{"/user/settings/applications"}) { for _, cookie := range resp.Result().Cookies() { - if cookie.Name != "macaron_flash" { + if cookie.Name != gitea_context.CookieNameFlash { continue } flash, _ := url.ParseQuery(cookie.Value) |