mirror of
https://gitee.com/johng/gf.git
synced 2024-12-01 19:57:40 +08:00
no printing internal middleware for ghttp.Server
(#3271)
This commit is contained in:
parent
73fbca40ca
commit
b4f6f06ab5
@ -161,6 +161,7 @@ const (
|
|||||||
specialMethodNameShut = "Shut"
|
specialMethodNameShut = "Shut"
|
||||||
specialMethodNameIndex = "Index"
|
specialMethodNameIndex = "Index"
|
||||||
defaultEndpointPort = 80
|
defaultEndpointPort = 80
|
||||||
|
noPrintInternalRoute = "internalMiddlewareServerTracing"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -301,6 +301,11 @@ func (s *Server) doRouterMapDump() {
|
|||||||
handlerName = gstr.TrimRightStr(item.Handler.Name, "-fm")
|
handlerName = gstr.TrimRightStr(item.Handler.Name, "-fm")
|
||||||
middlewares = gstr.SplitAndTrim(item.Middleware, ",")
|
middlewares = gstr.SplitAndTrim(item.Middleware, ",")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// No printing special internal middleware that may lead confused.
|
||||||
|
if gstr.SubStrFromREx(handlerName, ".") == noPrintInternalRoute {
|
||||||
|
continue
|
||||||
|
}
|
||||||
for k, v := range middlewares {
|
for k, v := range middlewares {
|
||||||
middlewares[k] = gstr.TrimRightStr(v, "-fm")
|
middlewares[k] = gstr.TrimRightStr(v, "-fm")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user