Skip to content

Commit

Permalink
Do not change global options when registering HttpClient correlation …
Browse files Browse the repository at this point in the history
…handler
  • Loading branch information
laurynasr committed Oct 4, 2023
1 parent 48b8509 commit 969ab18
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
2 changes: 1 addition & 1 deletion src/Correlate.Core/Http/CorrelateClientOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/// <summary>
/// Client options for adding correlation id to outgoing requests.
/// </summary>
public class CorrelateClientOptions : CorrelationManagerOptions
public class CorrelateClientOptions
{
/// <summary>
/// Gets or sets the request header to set the correlation id in for outgoing requests. Default 'X-Correlation-ID'.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,6 @@ public static IHttpClientBuilder CorrelateRequests(this IHttpClientBuilder build
throw new ArgumentNullException(nameof(builder));
}

builder.Services.AddOptions<CorrelationManagerOptions>()
.Configure((CorrelationManagerOptions cmo) =>
{
var options = new CorrelateClientOptions();
configureOptions(options);
cmo.LoggingScopeKey = options.LoggingScopeKey;
});

builder.Services.AddCorrelate();

builder.Services.TryAddTransient<CorrelatingHttpMessageHandler>();
Expand Down

0 comments on commit 969ab18

Please sign in to comment.