diff --git a/net/ghttp/ghttp.go b/net/ghttp/ghttp.go index 6d53f66d6..ddee035da 100644 --- a/net/ghttp/ghttp.go +++ b/net/ghttp/ghttp.go @@ -161,6 +161,7 @@ const ( specialMethodNameShut = "Shut" specialMethodNameIndex = "Index" defaultEndpointPort = 80 + noPrintInternalRoute = "internalMiddlewareServerTracing" ) const ( diff --git a/net/ghttp/ghttp_server.go b/net/ghttp/ghttp_server.go index 96059856c..1da5ce4a3 100644 --- a/net/ghttp/ghttp_server.go +++ b/net/ghttp/ghttp_server.go @@ -301,6 +301,11 @@ func (s *Server) doRouterMapDump() { handlerName = gstr.TrimRightStr(item.Handler.Name, "-fm") 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 { middlewares[k] = gstr.TrimRightStr(v, "-fm") }