mirror of
https://github.com/go-kratos/kratos.git
synced 2025-03-17 21:07:54 +02:00
parent
f51bd97324
commit
930d1f6cf7
@ -54,12 +54,13 @@ func Server(opts ...Option) middleware.Middleware {
|
||||
method = "POST"
|
||||
path = info.FullMethod
|
||||
} else if info, ok := http.FromServerContext(ctx); ok {
|
||||
method = info.Request.Method
|
||||
if route := mux.CurrentRoute(info.Request); route != nil {
|
||||
req := info.Request.WithContext(ctx)
|
||||
method = req.Method
|
||||
if route := mux.CurrentRoute(req); route != nil {
|
||||
// /path/123 -> /path/{id}
|
||||
path, _ = route.GetPathTemplate()
|
||||
} else {
|
||||
path = info.Request.RequestURI
|
||||
path = req.RequestURI
|
||||
}
|
||||
}
|
||||
startTime := time.Now()
|
||||
|
Loading…
x
Reference in New Issue
Block a user