Skip to content

Commit

Permalink
more feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>
  • Loading branch information
RyanLettieri committed Sep 7, 2023
1 parent bfa2b86 commit 5704c07
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/Dapr.Workflow/WorkflowServiceCollectionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ namespace Dapr.Workflow
/// </summary>
public static class WorkflowServiceCollectionExtensions
{
private static string daprApiToken = "";

/// <summary>
/// Adds Dapr Workflow support to the service collection.
Expand Down Expand Up @@ -62,10 +61,10 @@ public static IServiceCollection AddDaprWorkflow(
if (TryGetGrpcAddress(out string address))
{
daprApiToken = DaprDefaults.GetDefaultDaprApiToken();
var daprApiToken = DaprDefaults.GetDefaultDaprApiToken();
if (!string.IsNullOrEmpty(daprApiToken))
{
HttpClient client = new HttpClient();
var client = new HttpClient();
client.DefaultRequestHeaders.Add("Dapr-Api-Token", daprApiToken);
builder.UseGrpc(CreateChannel(address, client));
}
Expand Down Expand Up @@ -101,10 +100,10 @@ public static IServiceCollection AddDaprWorkflowClient(this IServiceCollection s
{
if (TryGetGrpcAddress(out string address))
{
daprApiToken = DaprDefaults.GetDefaultDaprApiToken();
var daprApiToken = DaprDefaults.GetDefaultDaprApiToken();
if (!string.IsNullOrEmpty(daprApiToken))
{
HttpClient client = new HttpClient();
var client = new HttpClient();
client.DefaultRequestHeaders.Add("Dapr-Api-Token", daprApiToken);
builder.UseGrpc(CreateChannel(address, client));
}
Expand Down

0 comments on commit 5704c07

Please sign in to comment.