Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set dapr-api-token to healthz requests when needed #1145

Merged
merged 2 commits into from
Sep 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/Dapr.Client/DaprClientGrpc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1743,6 +1743,12 @@
{
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);

Check warning on line 1749 in src/Dapr.Client/DaprClientGrpc.cs

View check run for this annotation

Codecov / codecov/patch

src/Dapr.Client/DaprClientGrpc.cs#L1749

Added line #L1749 was not covered by tests
}

try
{
using var response = await this.httpClient.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, cancellationToken);
Expand All @@ -1759,6 +1765,12 @@
{
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);

Check warning on line 1771 in src/Dapr.Client/DaprClientGrpc.cs

View check run for this annotation

Codecov / codecov/patch

src/Dapr.Client/DaprClientGrpc.cs#L1771

Added line #L1771 was not covered by tests
}

try
{
using var response = await this.httpClient.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, cancellationToken);
Expand Down
Loading