mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-12 08:44:04 +01:00
API: Remove auth check from cluster health endpoint #98
Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
@@ -65,22 +65,18 @@ func ClusterSummary(router *gin.RouterGroup) {
|
|||||||
// @Router /api/v1/cluster/health [get]
|
// @Router /api/v1/cluster/health [get]
|
||||||
func ClusterHealth(router *gin.RouterGroup) {
|
func ClusterHealth(router *gin.RouterGroup) {
|
||||||
router.GET("/cluster/health", func(c *gin.Context) {
|
router.GET("/cluster/health", func(c *gin.Context) {
|
||||||
s := Auth(c, acl.ResourceCluster, acl.ActionView)
|
|
||||||
|
|
||||||
if s.Abort(c) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
conf := get.Config()
|
conf := get.Config()
|
||||||
|
|
||||||
|
// Align headers with server-level health endpoints.
|
||||||
|
c.Header(header.CacheControl, header.CacheControlNoStore)
|
||||||
|
c.Header(header.AccessControlAllowOrigin, header.Any)
|
||||||
|
|
||||||
|
// Return error if not a portal node.
|
||||||
if !conf.IsPortal() {
|
if !conf.IsPortal() {
|
||||||
AbortFeatureDisabled(c)
|
AbortFeatureDisabled(c)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Align headers with server-level health endpoints
|
|
||||||
c.Header(header.CacheControl, header.CacheControlNoStore)
|
|
||||||
c.Header(header.AccessControlAllowOrigin, header.Any)
|
|
||||||
c.JSON(http.StatusOK, NewHealthResponse("ok"))
|
c.JSON(http.StatusOK, NewHealthResponse("ok"))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user