Skip to content

Commit

Permalink
- renames chaining method
Browse files Browse the repository at this point in the history
  • Loading branch information
baywet committed Jul 14, 2021
1 parent 0021195 commit e05c3c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions http/dotnet/httpclient/src/HttpClientBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public static class HttpClientBuilder {
/// <returns>The <see cref="HttpClient"/> with the default middlewares.</returns>
public static System.Net.Http.HttpClient Create(IAuthenticationProvider authenticationProvider = default) {
var defaultHandlers = CreateDefaultHandlers(authenticationProvider);
var handler = CreateMainHandlerFromHandlersCollection(defaultHandlers.ToArray());
var handler = ChainHandlersCollectionAndGetFirstLink(defaultHandlers.ToArray());
return handler != null ? new System.Net.Http.HttpClient(handler) : new System.Net.Http.HttpClient(); //TODO configure the default client options
}
/// <summary>
Expand All @@ -32,7 +32,7 @@ public static IList<DelegatingHandler> CreateDefaultHandlers(IAuthenticationProv
/// </summary>
/// <param name="handlers">The <see cref="DelegatingHandler"/> instances to create the <see cref="DelegatingHandler"/> from.</param>
/// <returns>The created <see cref="DelegatingHandler"/>.</returns>
public static DelegatingHandler CreateMainHandlerFromHandlersCollection(params DelegatingHandler[] handlers) {
public static DelegatingHandler ChainHandlersCollectionAndGetFirstLink(params DelegatingHandler[] handlers) {
if(handlers == null || !handlers.Any()) return default;
var handlersAsList = handlers.ToList();
handlersAsList.ForEach(h => {
Expand Down

0 comments on commit e05c3c0

Please sign in to comment.