]> source.dussan.org Git - gitea.git/commit
Ensure `GetCSRF` doesn't return an empty token (#32130)
authorJason Song <i@wolfogre.com>
Mon, 30 Sep 2024 02:28:09 +0000 (10:28 +0800)
committerGitHub <noreply@github.com>
Mon, 30 Sep 2024 02:28:09 +0000 (02:28 +0000)
commit13283873e9d523d5a5557f55d64f702c1a9f76ec
tree64d279628645732743129a23868f304f01bc3a3f
parent5015de4d9ae0765e7f79073a638d8da3a931f05b
Ensure `GetCSRF` doesn't return an empty token (#32130)

Since page templates keep changing, some pages that contained forms with
CSRF token no longer have them.

It leads to some calls of `GetCSRF` returning an empty string, which
fails the tests. Like

https://github.com/go-gitea/gitea/blob/3269b04d61ffe6a7ce462cd05ee150e4491124e8/tests/integration/attachment_test.go#L62-L63

The test did try to get the CSRF token and provided it, but it was
empty.
tests/integration/attachment_test.go
tests/integration/integration_test.go
tests/integration/org_test.go