Skip to content

Commit

Permalink
fix(grpc): meta merge
Browse files Browse the repository at this point in the history
  • Loading branch information
waitingsong committed Nov 13, 2024
1 parent b35590d commit caadbcf
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/grpc/src/comsumer/clients.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,16 @@ export class GRPCClients extends Map {
connectionService[methodName] = (
clientOptions: IClientOptions = {}
) => {
const meta = new Metadata();
clientOptions.metadata.set('rpc.definition', definition);
clientOptions.metadata.set('rpc.method', methodName);

if (clientOptions.metadata) {
const meta = new Metadata();
meta.merge(clientOptions.metadata);
clientOptions.metadata = meta;
} else {
clientOptions.metadata = new Metadata();
clientOptions.metadata = meta;
}
clientOptions.metadata.set('rpc.definition', definition);
clientOptions.metadata.set('rpc.method', methodName);

return this.getClientRequestImpl(
connectionService,
Expand Down

0 comments on commit caadbcf

Please sign in to comment.