We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Go
go version go1.18.4 windows/amd64
GoFrame
v2.1.4
yes
我注册了一个前置的全局中间件以实现ACL:
g.Server().Use(func(req *ghttp.Request) { if req. ... { // 此处进行权限判断 req.Response.ClearBuffer() req.Response.WriteStatusExit(403, nil) } req.Middleware.Next() ... })
现在需要有一部分路由可以匿名访问,但我无法在上面代码中的权限判断时获取到req.Middleware.Next()后的理论路由,现在在全局中间件中的req.Router只能获取到全局中间件的路由。
req.Middleware.Next()
req.Router
但是在调试时发现未导出的req.handlers中已经可以取到我注册的动态路由,如通过判断req.handlers[...].Handler.Name是否存在预期的可匿名访问的路由来决定是否放行。
req.handlers
req.handlers[...].Handler.Name
能否开放相关接口获取到理论状态下的路由情况。
The text was updated successfully, but these errors were encountered:
No branches or pull requests
1. What version of
Go
and system type/arch are you using?go version go1.18.4 windows/amd64
2. What version of
GoFrame
are you using?v2.1.4
3. Can this issue be re-produced with the latest release?
yes
4. What did you do?
我注册了一个前置的全局中间件以实现ACL:
现在需要有一部分路由可以匿名访问,但我无法在上面代码中的权限判断时获取到
req.Middleware.Next()
后的理论路由,现在在全局中间件中的req.Router
只能获取到全局中间件的路由。但是在调试时发现未导出的
req.handlers
中已经可以取到我注册的动态路由,如通过判断req.handlers[...].Handler.Name
是否存在预期的可匿名访问的路由来决定是否放行。5. What did you expect to see?
能否开放相关接口获取到理论状态下的路由情况。
6. What did you see instead?
The text was updated successfully, but these errors were encountered: