diff options
| author | crobibero <cody@robibe.ro> | 2020-08-19 06:31:45 -0600 |
|---|---|---|
| committer | crobibero <cody@robibe.ro> | 2020-08-19 06:31:45 -0600 |
| commit | 076e17f35556c6d1257856896619e30eb494b2bb (patch) | |
| tree | 6078303f35f0cd2ac33a33fcf4558be88f86c248 /Jellyfin.Server/Startup.cs | |
| parent | 93fe595e5e9863874c1973e4f2d7f3c85549d3f9 (diff) | |
Add default http client
Diffstat (limited to 'Jellyfin.Server/Startup.cs')
| -rw-r--r-- | Jellyfin.Server/Startup.cs | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/Jellyfin.Server/Startup.cs b/Jellyfin.Server/Startup.cs index 108d8f881..05deaa2e0 100644 --- a/Jellyfin.Server/Startup.cs +++ b/Jellyfin.Server/Startup.cs @@ -1,13 +1,20 @@ +using System.Diagnostics; +using System.Net; using System.Net.Http; +using System.Reflection; +using Emby.Server.Implementations; using Jellyfin.Server.Extensions; +using Jellyfin.Server.Implementations; using Jellyfin.Server.Middleware; using Jellyfin.Server.Models; +using MediaBrowser.Common.Net; using MediaBrowser.Controller; using MediaBrowser.Controller.Configuration; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Http.Logging; using Prometheus; namespace Jellyfin.Server @@ -44,7 +51,13 @@ namespace Jellyfin.Server services.AddCustomAuthentication(); services.AddJellyfinApiAuthorization(); - services.AddHttpClient(); + + services + .AddTransient<UserAgentDelegatingHandler>() + .AddHttpClient<DefaultHttpClient>() + .ConfigureHttpClient((sp, options) => {}) + .ConfigurePrimaryHttpMessageHandler(x => new DefaultHttpClientHandler()) + .AddHttpMessageHandler<UserAgentDelegatingHandler>(); } /// <summary> |
