diff options
| author | Bond_009 <bond.009@outlook.com> | 2022-03-08 22:57:47 +0100 |
|---|---|---|
| committer | Bond_009 <bond.009@outlook.com> | 2022-03-08 23:00:43 +0100 |
| commit | cafeedcadfa93259529a79cc417faccf20154bd1 (patch) | |
| tree | 00d16d26d126fc9f6c862856a74278186e145eda /Jellyfin.Server/Startup.cs | |
| parent | 03f1eff21abf75d88d15df05b6a841e48943c7ef (diff) | |
Rework SsdpHttpClient
Diffstat (limited to 'Jellyfin.Server/Startup.cs')
| -rw-r--r-- | Jellyfin.Server/Startup.cs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Jellyfin.Server/Startup.cs b/Jellyfin.Server/Startup.cs index 8eb5f2196..2cb6d937a 100644 --- a/Jellyfin.Server/Startup.cs +++ b/Jellyfin.Server/Startup.cs @@ -1,4 +1,5 @@ using System; +using System.Globalization; using System.Net; using System.Net.Http; using System.Net.Http.Headers; @@ -103,6 +104,22 @@ namespace Jellyfin.Server }) .ConfigurePrimaryHttpMessageHandler(defaultHttpClientHandlerDelegate); + services.AddHttpClient(NamedClient.Dlna, c => + { + c.DefaultRequestHeaders.UserAgent.ParseAdd( + string.Format( + CultureInfo.InvariantCulture, + "{0}/{1} UPnP/1.1 {2}/{3}", + MediaBrowser.Common.System.OperatingSystem.Name, + Environment.OSVersion, + _serverApplicationHost.Name, + _serverApplicationHost.ApplicationVersionString)); + + c.DefaultRequestHeaders.Add("CPFN.UPNP.ORG", _serverApplicationHost.FriendlyName); // Required for UPnP DeviceArchitecture v2.0 + c.DefaultRequestHeaders.Add("FriendlyName.DLNA.ORG", _serverApplicationHost.FriendlyName); // REVIEW: where does this come from? + }) + .ConfigurePrimaryHttpMessageHandler(defaultHttpClientHandlerDelegate); + services.AddHealthChecks() .AddDbContextCheck<JellyfinDb>(); |
