fix(server): prevent SPA fallback from swallowing API routes
- add ShouldSkipSPAFallback() deny prefixes: /api, /admin/api, /payments, /pay - apply StaticWithConfig Skipper in both main http server and install server - add unit tests for fallback skip matching behavior
This commit is contained in:
@@ -72,6 +72,9 @@ func HttpServerStart() {
|
||||
}
|
||||
}
|
||||
e.Use(echoMiddleware.StaticWithConfig(echoMiddleware.StaticConfig{
|
||||
Skipper: func(c echo.Context) bool {
|
||||
return luluHttp.ShouldSkipSPAFallback(c.Request().URL.Path)
|
||||
},
|
||||
HTML5: true,
|
||||
Index: "index.html",
|
||||
Root: wwwRoot,
|
||||
|
||||
Reference in New Issue
Block a user