Skip to content

Commit 3435c1b

Browse files
committed
Update
1 parent 497f6d7 commit 3435c1b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Grpc.Net.ClientFactory/GrpcClientServiceExtensions.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ private static IHttpClientBuilder AddGrpcHttpClient<
308308

309309
services.AddHttpClient(name);
310310

311-
// Get PrimaryHandler o we can track whether the user set a value or not.
311+
// Get PrimaryHandler and store it to compare later. Used to track whether the user set a handler or not.
312312
// This action comes before registered user actions so the primary handler here will be the one created by the factory.
313313
HttpMessageHandler? initialPrimaryHandler = null;
314314
services.Configure<HttpClientFactoryOptions>(name, options =>
@@ -320,6 +320,8 @@ private static IHttpClientBuilder AddGrpcHttpClient<
320320
{
321321
options.HttpMessageHandlerBuilderActions.Add(builder =>
322322
{
323+
// If the primary handler is unchanged from what the factory created then replace the handler
324+
// with one that has settings optimized for a gRPC client.
323325
if (builder.PrimaryHandler == initialPrimaryHandler)
324326
{
325327
// This will throw in .NET Standard 2.0 with a prompt that a user must set a handler.

0 commit comments

Comments
 (0)