Preserve backwards compatibility of health endpoint (#593)

This commit is contained in:
Sung Won Cho 2022-04-24 11:32:04 +10:00 committed by GitHub
commit a4b7a07bff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View file

@ -39,7 +39,7 @@ func TestHealth(t *testing.T) {
defer server.Close()
// Execute
req := testutils.MakeReq(server.URL, "GET", "/api/health", "")
req := testutils.MakeReq(server.URL, "GET", "/health", "")
res := testutils.HTTPDo(t, req)
// Test

View file

@ -43,6 +43,8 @@ func NewWebRoutes(a *app.App, c *Controllers) []Route {
{"GET", "/verify-email/{token}", mw.Auth(a, c.Users.VerifyEmail, redirectGuest), true},
{"PATCH", "/account/profile", mw.Auth(a, c.Users.ProfileUpdate, nil), true},
{"PATCH", "/account/password", mw.Auth(a, c.Users.PasswordUpdate, nil), true},
{"GET", "/health", c.Health.Index, true},
}
if !a.Config.DisableRegistration {
@ -59,9 +61,6 @@ func NewAPIRoutes(a *app.App, c *Controllers) []Route {
proOnly := mw.AuthParams{ProOnly: true}
return []Route{
// internal
{"GET", "/health", c.Health.Index, true},
// v3
{"GET", "/v3/sync/fragment", mw.Cors(mw.Auth(a, c.Sync.GetSyncFragment, &proOnly)), false},
{"GET", "/v3/sync/state", mw.Cors(mw.Auth(a, c.Sync.GetSyncState, &proOnly)), false},