feat: force http to https redirect even when tls is disabled

This commit is contained in:
Johan Siebens
2022-09-10 09:18:32 +02:00
parent 88509c826d
commit 9281deb549
3 changed files with 20 additions and 1 deletions
+1 -1
View File
@@ -120,7 +120,7 @@ func Start(c *config.Config) error {
nonTlsAppHandler.Any("/*", handlers.HttpRedirectHandler(c.Tls))
tlsAppHandler := echo.New()
tlsAppHandler.Pre(middleware.HTTPSRedirect())
tlsAppHandler.Pre(handlers.HttpsRedirect(c.Tls))
tlsAppHandler.Renderer = templates.NewTemplates()
tlsAppHandler.Use(EchoRecover(logger))
tlsAppHandler.Use(EchoLogger(logger))