|
|
@@ -4,7 +4,7 @@ import (
|
|
|
"context"
|
|
|
"fmt"
|
|
|
|
|
|
- "git.ikuban.com/server/kratos-utils/http/param"
|
|
|
+ "google.golang.org/grpc/metadata"
|
|
|
|
|
|
context2 "git.ikuban.com/server/kratos-utils/http/context"
|
|
|
|
|
|
@@ -45,6 +45,7 @@ func Server(opts ...Option) middleware.Middleware {
|
|
|
method string
|
|
|
params string
|
|
|
component string
|
|
|
+ fromPath string
|
|
|
)
|
|
|
if info, ok := http.FromServerContext(ctx); ok {
|
|
|
component = "HTTP"
|
|
|
@@ -56,8 +57,13 @@ func Server(opts ...Option) middleware.Middleware {
|
|
|
path = info.FullMethod
|
|
|
method = "POST"
|
|
|
params = req.(fmt.Stringer).String()
|
|
|
+ if md, ok := metadata.FromIncomingContext(ctx); ok {
|
|
|
+ _fromPath := md.Get("from_path")
|
|
|
+ if len(_fromPath) > 0 {
|
|
|
+ fromPath = _fromPath[0]
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- fromPath := param.GetFromPath(ctx)
|
|
|
if fromPath != "" {
|
|
|
ctx = context2.AppendToContext(ctx, "from_path", fromPath+"|"+path)
|
|
|
} else {
|