mirror of
https://github.com/pocketbase/pocketbase.git
synced 2026-11-04 02:57:26 +01:00
[#2072] registered RemoveTrailingSlash middleware only for the /api/* routes
This commit is contained in:
1 parent
e735d9d21b
commit
254e691e92
2 files changed
+75
-2
No files matched your search
+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