aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server/Startup.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Jellyfin.Server/Startup.cs')
-rw-r--r--Jellyfin.Server/Startup.cs15
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>