diff --git a/Ringleader.sln b/Ringleader.sln index 326e5d3..7efce3a 100644 --- a/Ringleader.sln +++ b/Ringleader.sln @@ -9,13 +9,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RingleaderTests", "Ringlead EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebExample", "WebExample\WebExample.csproj", "{219EDA92-D634-40C0-A71A-7B49275FF086}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E7CBD922-598B-4B9A-B72D-3D3C28A9B136}" - ProjectSection(SolutionItems) = preProject - .gitignore = .gitignore - .github\workflows\dotnetcore.yml = .github\workflows\dotnetcore.yml - README.md = README.md - EndProjectSection -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU diff --git a/Ringleader/HttpClientFactory/ContextualHandlerBuilderFilter.cs b/Ringleader/HttpClientFactory/ContextualHandlerBuilderFilter.cs index d1f9ca7..6ed9902 100644 --- a/Ringleader/HttpClientFactory/ContextualHandlerBuilderFilter.cs +++ b/Ringleader/HttpClientFactory/ContextualHandlerBuilderFilter.cs @@ -30,7 +30,7 @@ public Action Configure(Action based on a specified client and/or context /// public Func HandlerFactory { get; set; } - = (client, context) => new HttpClientHandler(); + = (client, context) => null; } /// @@ -27,7 +27,7 @@ public DefaultActionedPrimaryHandlerFactory(IOptionsMonitor _options.CurrentValue.HandlerFactory.Invoke(clientName, handlerContext) ?? new HttpClientHandler(); + public HttpMessageHandler? CreateHandler(string clientName, string handlerContext) + => _options.CurrentValue.HandlerFactory.Invoke(clientName, handlerContext); } } diff --git a/Ringleader/HttpClientFactory/Interfaces/IPrimaryHandlerFactory.cs b/Ringleader/HttpClientFactory/Interfaces/IPrimaryHandlerFactory.cs index e7fcb4e..2a35f37 100644 --- a/Ringleader/HttpClientFactory/Interfaces/IPrimaryHandlerFactory.cs +++ b/Ringleader/HttpClientFactory/Interfaces/IPrimaryHandlerFactory.cs @@ -6,11 +6,11 @@ namespace Ringleader.HttpClientFactory public interface IPrimaryHandlerFactory { /// - /// Generate a primary based on a supplied name and handler context + /// Optionally create a custom primary based on a supplied name and handler context /// /// name /// Handler context for the - /// An configured based on the context - HttpMessageHandler CreateHandler(string clientName, string handlerContext); + /// An configured based on the context, or to use the default handler + HttpMessageHandler? CreateHandler(string clientName, string handlerContext); } } diff --git a/Ringleader/Ringleader.csproj b/Ringleader/Ringleader.csproj index d9b746f..e671dfb 100644 --- a/Ringleader/Ringleader.csproj +++ b/Ringleader/Ringleader.csproj @@ -3,15 +3,16 @@ net6.0 Adam Gertenbach - Extends the NET Core default HttpClientFactory to support managing and applying contextually appropriate primary handlers (i.e. unique certificates for different endpoints) while retaining the benefits of handler pooling and typed client pipelines. + Extends the .NET DefaultHttpClientFactory to support contextually appropriate primary handlers (i.e. unique certificates for different endpoints) and per-request cookie scope while retaining the benefits of handler pooling and typed client pipelines. 2020-2024 Adam Gertenbach true - 2.0.0 + 2.0.1 LICENSE https://github.com/agertenbach/Ringleader https://github.com/agertenbach/Ringleader enable README.md + HttpClientFactory;IHttpClientFactory;HttpClient;DefaultHttpClientFactory;Cookies;Certificates;MessageHandler;PrimaryHandler;