diff --git a/handlers/dashboard.go b/handlers/dashboard.go index 45dde7a..85e8ebd 100644 --- a/handlers/dashboard.go +++ b/handlers/dashboard.go @@ -10,9 +10,9 @@ import ( "github.com/gin-gonic/gin" ) -func ErrorPage(context *gin.Context) { - render := utils.NewTempl(context, http.StatusOK, layouts.Error404()) - context.Render(http.StatusOK, render) +func NotFoundPage(context *gin.Context) { + render := utils.NewTempl(context, http.StatusNotFound, layouts.Error404()) + context.Render(http.StatusNotFound, render) } func HomeDashboard(context *gin.Context) { diff --git a/routes/routes.go b/routes/routes.go index f9f556f..4615beb 100644 --- a/routes/routes.go +++ b/routes/routes.go @@ -18,10 +18,7 @@ import ( const requiredGroupPermission = "soarca_admin" func Setup(app *gin.Engine) { - app.GET("/404-page", handlers.ErrorPage) - app.NoRoute(func(ctx *gin.Context) { - ctx.Redirect(http.StatusTemporaryRedirect, "/404-page") - }) + app.NoRoute(handlers.NotFoundPage) authEnabled, _ := strconv.ParseBool(utils.GetEnv("AUTH_ENABLED", "false")) reporter := soarca.NewReport(utils.GetEnv("SOARCA_URI", "http://localhost:8080"), &http.Client{}, authEnabled) @@ -110,4 +107,4 @@ func ManualRoutes(manual backend.Manual, app *gin.RouterGroup, authentication bo manualRoutes.GET("/", manualHandler.ManualActionsHandler) manualRoutes.POST("/continue", manualHandler.ManualContinueHandler) } -} \ No newline at end of file +}