Use consistent handler defaults in docs and samples (#2451)
This commit is contained in:
Родитель
fc9929f693
Коммит
83c3607a6a
|
@ -58,12 +58,13 @@ builder.Services.AddHttpForwarder();
|
|||
var app = builder.Build();
|
||||
|
||||
// Configure our own HttpMessageInvoker for outbound calls for proxy operations
|
||||
var httpClient = new HttpMessageInvoker(new SocketsHttpHandler()
|
||||
var httpClient = new HttpMessageInvoker(new SocketsHttpHandler
|
||||
{
|
||||
UseProxy = false,
|
||||
AllowAutoRedirect = false,
|
||||
AutomaticDecompression = DecompressionMethods.None,
|
||||
UseCookies = false,
|
||||
EnableMultipleHttp2Connections = true,
|
||||
ActivityHeadersPropagator = new ReverseProxyPropagator(DistributedContextPropagator.Current),
|
||||
ConnectTimeout = TimeSpan.FromSeconds(15),
|
||||
});
|
||||
|
|
|
@ -205,6 +205,7 @@ new SocketsHttpHandler
|
|||
AllowAutoRedirect = false,
|
||||
AutomaticDecompression = DecompressionMethods.None,
|
||||
UseCookies = false,
|
||||
EnableMultipleHttp2Connections = true,
|
||||
ActivityHeadersPropagator = new ReverseProxyPropagator(DistributedContextPropagator.Current),
|
||||
ConnectTimeout = TimeSpan.FromSeconds(15),
|
||||
};
|
||||
|
@ -227,7 +228,9 @@ public class CustomForwarderHttpClientFactory : IForwarderHttpClientFactory
|
|||
AllowAutoRedirect = false,
|
||||
AutomaticDecompression = DecompressionMethods.None,
|
||||
UseCookies = false,
|
||||
ActivityHeadersPropagator = new ReverseProxyPropagator(DistributedContextPropagator.Current)
|
||||
EnableMultipleHttp2Connections = true,
|
||||
ActivityHeadersPropagator = new ReverseProxyPropagator(DistributedContextPropagator.Current),
|
||||
ConnectTimeout = TimeSpan.FromSeconds(15),
|
||||
};
|
||||
|
||||
return new HttpMessageInvoker(handler, disposeHandler: true);
|
||||
|
|
|
@ -20,12 +20,13 @@ builder.Services.AddHttpForwarder();
|
|||
var app = builder.Build();
|
||||
|
||||
// Configure our own HttpMessageInvoker for outbound calls for proxy operations
|
||||
var httpClient = new HttpMessageInvoker(new SocketsHttpHandler()
|
||||
var httpClient = new HttpMessageInvoker(new SocketsHttpHandler
|
||||
{
|
||||
UseProxy = false,
|
||||
AllowAutoRedirect = false,
|
||||
AutomaticDecompression = DecompressionMethods.None,
|
||||
UseCookies = false,
|
||||
EnableMultipleHttp2Connections = true,
|
||||
ActivityHeadersPropagator = new ReverseProxyPropagator(DistributedContextPropagator.Current),
|
||||
ConnectTimeout = TimeSpan.FromSeconds(15),
|
||||
});
|
||||
|
|
|
@ -47,6 +47,7 @@ public class ForwarderHttpClientFactory : IForwarderHttpClientFactory
|
|||
AllowAutoRedirect = false,
|
||||
AutomaticDecompression = DecompressionMethods.None,
|
||||
UseCookies = false,
|
||||
EnableMultipleHttp2Connections = true,
|
||||
ActivityHeadersPropagator = new ReverseProxyPropagator(DistributedContextPropagator.Current),
|
||||
ConnectTimeout = TimeSpan.FromSeconds(15),
|
||||
|
||||
|
|
|
@ -36,12 +36,13 @@ builder.Services.AddHttpForwarder();
|
|||
|
||||
var app = builder.Build();
|
||||
|
||||
var httpClient = new HttpMessageInvoker(new SocketsHttpHandler()
|
||||
var httpClient = new HttpMessageInvoker(new SocketsHttpHandler
|
||||
{
|
||||
UseProxy = false,
|
||||
AllowAutoRedirect = false,
|
||||
AutomaticDecompression = DecompressionMethods.None,
|
||||
UseCookies = false,
|
||||
EnableMultipleHttp2Connections = true,
|
||||
ActivityHeadersPropagator = new ReverseProxyPropagator(DistributedContextPropagator.Current),
|
||||
ConnectTimeout = TimeSpan.FromSeconds(15),
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче