[#2072] registered RemoveTrailingSlash middleware only for the /api/* routes
This commit is contained in:
+2
-2
@@ -36,8 +36,8 @@ func InitApi(app core.App) (*echo.Echo, error) {
|
||||
// default middlewares
|
||||
e.Pre(middleware.RemoveTrailingSlashWithConfig(middleware.RemoveTrailingSlashConfig{
|
||||
Skipper: func(c echo.Context) bool {
|
||||
// ignore Admin UI route(s)
|
||||
return strings.HasPrefix(c.Request().URL.Path, trailedAdminPath)
|
||||
// enable by default only for the API routes
|
||||
return !strings.HasPrefix(c.Request().URL.Path, "/api/")
|
||||
},
|
||||
}))
|
||||
e.Use(middleware.Recover())
|
||||
|
||||
Reference in New Issue
Block a user