mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-07-22 17:18:33 +00:00
Merge pull request '[v7.0/forgejo] Fix #3030 add Cache-Control header for health-check' (#3074) from bp-v7.0/forgejo-323d7ad-84f5115-d2ff8f8-b210a3e into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3074 Reviewed-by: Gusted <gusted@noreply.codeberg.org>
This commit is contained in:
commit
1065ee4a60
2 changed files with 47 additions and 21 deletions
25
tests/integration/api_health_test.go
Normal file
25
tests/integration/api_health_test.go
Normal file
|
@ -0,0 +1,25 @@
|
|||
package integration
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
"code.gitea.io/gitea/routers/web/healthcheck"
|
||||
"code.gitea.io/gitea/tests"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestApiHeatlhCheck(t *testing.T) {
|
||||
defer tests.PrepareTestEnv(t)()
|
||||
|
||||
req := NewRequest(t, "GET", "/api/healthz")
|
||||
resp := MakeRequest(t, req, http.StatusOK)
|
||||
assert.Contains(t, resp.Header().Values("Cache-Control"), "no-store")
|
||||
|
||||
var status healthcheck.Response
|
||||
DecodeJSON(t, resp, &status)
|
||||
assert.Equal(t, healthcheck.Pass, status.Status)
|
||||
assert.Equal(t, setting.AppName, status.Description)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue