diff --git a/cmd/dashboard/controller/controller.go b/cmd/dashboard/controller/controller.go index 7f00bbb..e1c7b7a 100644 --- a/cmd/dashboard/controller/controller.go +++ b/cmd/dashboard/controller/controller.go @@ -309,11 +309,13 @@ func fallbackToFrontend(frontendDist fs.FS) func(*gin.Context) { if strings.HasPrefix(c.Request.URL.Path, "/dashboard") { stripPath := strings.TrimPrefix(c.Request.URL.Path, "/dashboard") localFilePath := path.Join(singleton.Conf.AdminTemplate, stripPath) + if stripPath == "/" { + c.Status(http.StatusOK) + } if checkLocalFileOrFs(c, frontendDist, localFilePath) { return } else { c.Status(http.StatusNotFound) - c.Writer.WriteHeaderNow(); } if !checkLocalFileOrFs(c, frontendDist, singleton.Conf.AdminTemplate+"/index.html") { c.JSON(http.StatusNotFound, newErrorResponse(errors.New("404 Not Found"))) @@ -321,11 +323,13 @@ func fallbackToFrontend(frontendDist fs.FS) func(*gin.Context) { return } localFilePath := path.Join(singleton.Conf.UserTemplate, c.Request.URL.Path) + if c.Request.URL.Path == "/" { + c.Status(http.StatusOK) + } if checkLocalFileOrFs(c, frontendDist, localFilePath) { return } else { c.Status(http.StatusNotFound) - c.Writer.WriteHeaderNow(); } if !checkLocalFileOrFs(c, frontendDist, singleton.Conf.UserTemplate+"/index.html") { c.JSON(http.StatusNotFound, newErrorResponse(errors.New("404 Not Found"))) diff --git a/service/singleton/frontend-templates.yaml b/service/singleton/frontend-templates.yaml index d25497e..18fd2d3 100644 --- a/service/singleton/frontend-templates.yaml +++ b/service/singleton/frontend-templates.yaml @@ -2,7 +2,7 @@ name: "OfficialAdmin" repository: "https://github.com/nezhahq/admin-frontend" author: "nezhahq" - version: "v1.5.0" + version: "v1.5.1" isadmin: true isofficial: true - path: "user-dist"