mirror of https://github.com/grpc/grpc-node.git
grpc-js: Handle race between call cancellation and auth metadata generation
This commit is contained in:
parent
f6dd4aad55
commit
30bc44f4ce
|
@ -140,6 +140,12 @@ export class LoadBalancingCall implements Call {
|
|||
.generateMetadata({ service_url: this.serviceUrl })
|
||||
.then(
|
||||
credsMetadata => {
|
||||
/* If this call was cancelled (e.g. by the deadline) before
|
||||
* metadata generation finished, we shouldn't do anything with
|
||||
* it. */
|
||||
if (this.ended) {
|
||||
return;
|
||||
}
|
||||
const finalMetadata = this.metadata!.clone();
|
||||
finalMetadata.merge(credsMetadata);
|
||||
if (finalMetadata.get('authorization').length > 1) {
|
||||
|
|
Loading…
Reference in New Issue