mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
don't auto-redirect HttpClient
This commit is contained in:
parent
97db616f88
commit
fd4a037f94
1 changed files with 7 additions and 2 deletions
|
|
@ -1,4 +1,5 @@
|
|||
using FilterLists.Agent.AppSettings;
|
||||
using System.Net.Http;
|
||||
using FilterLists.Agent.AppSettings;
|
||||
using FilterLists.Agent.Core.Interfaces;
|
||||
using FilterLists.Agent.Infrastructure.Clients;
|
||||
using FilterLists.Agent.Infrastructure.Repositories;
|
||||
|
|
@ -17,7 +18,11 @@ public static void RegisterAgentServices(this IServiceCollection services)
|
|||
services.AddConfiguration();
|
||||
services.AddLoggingCustom();
|
||||
services.AddMediatR(typeof(Program).Assembly);
|
||||
services.AddHttpClient<AgentHttpClient>();
|
||||
services.AddHttpClient<AgentHttpClient>().ConfigureHttpMessageHandlerBuilder(b =>
|
||||
{
|
||||
b.PrimaryHandler = new HttpClientHandler {AllowAutoRedirect = false};
|
||||
b.Build();
|
||||
});
|
||||
services.AddSingleton<IFilterListsApiClient, FilterListsApiClient>();
|
||||
services.AddSingleton<IAgentGitHubClient, AgentGitHubClient>();
|
||||
services.AddTransient<IListInfoRepository, ListInfoRepository>();
|
||||
|
|
|
|||
Loading…
Reference in a new issue