1
0
mirror of https://github.com/gusaul/grpcox.git synced 2024-12-25 18:10:11 +00:00

Merge pull request #42 from AlessandroLimTkp/fix-concurrent-metadata-issue

fix: stop resource headers from bleeding into invoke
This commit is contained in:
Muhammad Auliya 2023-06-23 11:19:26 +07:00 committed by GitHub
commit 6feae4127c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -83,6 +83,7 @@ func (g *GrpCox) GetResource(ctx context.Context, target string, plainText, isRe
return nil, err return nil, err
} }
// what is r.Headers used for?
r.headers = h r.headers = h
g.activeConn.addConnection(target, r, g.maxLifeConn) g.activeConn.addConnection(target, r, g.maxLifeConn)

View File

@ -210,7 +210,7 @@ func (r *Resource) Invoke(ctx context.Context, metadata []string, symbol string,
} }
h := grpcurl.NewDefaultEventHandler(&resultBuffer, r.descSource, formatter, false) h := grpcurl.NewDefaultEventHandler(&resultBuffer, r.descSource, formatter, false)
var headers = r.headers var headers []string
if len(metadata) != 0 { if len(metadata) != 0 {
headers = metadata headers = metadata
} }