fix: skip api error for static middleware (#941)

This commit is contained in:
boojack
2023-01-13 07:06:15 +08:00
committed by GitHub
parent 1441a1df1f
commit 40d25f7dca
3 changed files with 10 additions and 7 deletions

View File

@ -22,6 +22,11 @@ func DefaultGetRequestSkipper(c echo.Context) bool {
return c.Request().Method == http.MethodGet
}
func DefaultAPIRequestSkipper(c echo.Context) bool {
path := c.Path()
return common.HasPrefixes(path, "/api")
}
func (server *Server) DefaultAuthSkipper(c echo.Context) bool {
ctx := c.Request().Context()
path := c.Path()