1
0
Fork 0
mirror of https://github.com/TwiN/gatus.git synced 2024-12-15 17:51:09 +00:00

fix(security): Make sure to panic on start if the security middlewares return an error

This commit is contained in:
TwiN 2022-01-08 19:52:11 -05:00
parent f6f7e15735
commit 9cb8c37298

View file

@ -22,7 +22,9 @@ func CreateRouter(staticFolder string, securityConfig *security.Config, uiConfig
if err := securityConfig.RegisterHandlers(router); err != nil { if err := securityConfig.RegisterHandlers(router); err != nil {
panic(err) panic(err)
} }
securityConfig.ApplySecurityMiddleware(protected) if err := securityConfig.ApplySecurityMiddleware(protected); err != nil {
panic(err)
}
} }
// Endpoints // Endpoints
unprotected.Handle("/v1/config", ConfigHandler{securityConfig: securityConfig}).Methods("GET") unprotected.Handle("/v1/config", ConfigHandler{securityConfig: securityConfig}).Methods("GET")