diff --git a/src/Dapr.Client/DaprClientGrpc.cs b/src/Dapr.Client/DaprClientGrpc.cs index 79f7f59ae..75df09323 100644 --- a/src/Dapr.Client/DaprClientGrpc.cs +++ b/src/Dapr.Client/DaprClientGrpc.cs @@ -1743,6 +1743,12 @@ public override async Task CheckHealthAsync(CancellationToken cancellation { var path = "/v1.0/healthz"; var request = new HttpRequestMessage(HttpMethod.Get, new Uri(this.httpEndpoint, path)); + + if (this.apiTokenHeader is not null) + { + request.Headers.Add(this.apiTokenHeader.Value.Key, this.apiTokenHeader.Value.Value); + } + try { using var response = await this.httpClient.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, cancellationToken); @@ -1759,6 +1765,12 @@ public override async Task CheckOutboundHealthAsync(CancellationToken canc { var path = "/v1.0/healthz/outbound"; var request = new HttpRequestMessage(HttpMethod.Get, new Uri(this.httpEndpoint, path)); + + if (this.apiTokenHeader is not null) + { + request.Headers.Add(this.apiTokenHeader.Value.Key, this.apiTokenHeader.Value.Value); + } + try { using var response = await this.httpClient.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, cancellationToken);