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

@ -56,9 +56,7 @@ func NewServer(ctx context.Context, profile *profile.Profile) (*Server, error) {
e.Use(middleware.Gzip())
e.Use(middleware.CSRFWithConfig(middleware.CSRFConfig{
Skipper: func(c echo.Context) bool {
return s.DefaultAuthSkipper(c)
},
Skipper: s.DefaultAuthSkipper,
TokenLookup: "cookie:_csrf",
}))
@ -73,7 +71,6 @@ func NewServer(ctx context.Context, profile *profile.Profile) (*Server, error) {
}))
e.Use(middleware.TimeoutWithConfig(middleware.TimeoutConfig{
Skipper: middleware.DefaultSkipper,
ErrorMessage: "Request timeout",
Timeout: 30 * time.Second,
}))