Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions handlers/dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
7 changes: 2 additions & 5 deletions routes/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -110,4 +107,4 @@ func ManualRoutes(manual backend.Manual, app *gin.RouterGroup, authentication bo
manualRoutes.GET("/", manualHandler.ManualActionsHandler)
manualRoutes.POST("/continue", manualHandler.ManualContinueHandler)
}
}
}