mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-02-02 18:28:41 +08:00
Merge pull request #90 from monotone/patch-1
fix: pre filter middleware not working
This commit is contained in:
commit
82483bd7b9
@ -59,7 +59,7 @@ func (s *sMiddleware) GenRouteKey(method, path string) string {
|
|||||||
// PreFilter 请求输入预处理
|
// PreFilter 请求输入预处理
|
||||||
// api使用gf规范路由并且XxxReq结构体实现了validate.Filter接口即可
|
// api使用gf规范路由并且XxxReq结构体实现了validate.Filter接口即可
|
||||||
func (s *sMiddleware) PreFilter(r *ghttp.Request) {
|
func (s *sMiddleware) PreFilter(r *ghttp.Request) {
|
||||||
router, ok := s.GetFilterRoutes(r)[s.GenFilterRouteKey(r.Router)]
|
router, ok := s.GetFilterRoutes(r)[s.GenFilterRequestKey(r)]
|
||||||
if !ok {
|
if !ok {
|
||||||
r.Middleware.Next()
|
r.Middleware.Next()
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user