Skip to content

Commit

Permalink
fix(grpc): fix issue with client without metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
PxyUp committed Jan 29, 2021
1 parent beba026 commit 41df407
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions integrations/grpc/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ func NewServerStreamInterceptor(app *core.Application) grpc.StreamServerIntercep
md, ok := metadata.FromIncomingContext(ss.Context())
var parent *core.Transaction
if ok {
id := md.Get(app.GetTracingHeader())[0]
if id != "" {
metaArr := md.Get(app.GetTracingHeader())
if len(metaArr) > 0 && metaArr[0] != "" {
parent = &core.Transaction{
Id: id,
Id: metaArr[0],
}
}
}
Expand All @@ -108,10 +108,10 @@ func NewServerUnaryInterceptor(app *core.Application) grpc.UnaryServerIntercepto
md, ok := metadata.FromIncomingContext(ctx)
var parent *core.Transaction
if ok {
id := md.Get(app.GetTracingHeader())[0]
if id != "" {
metaArr := md.Get(app.GetTracingHeader())
if len(metaArr) > 0 && metaArr[0] != "" {
parent = &core.Transaction{
Id: id,
Id: metaArr[0],
}
}
}
Expand Down

0 comments on commit 41df407

Please sign in to comment.