aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/ApplicationHost.cs
diff options
context:
space:
mode:
authorMark Monteiro <marknr.monteiro@protonmail.com>2020-04-02 13:51:53 -0400
committerMark Monteiro <marknr.monteiro@protonmail.com>2020-04-02 13:51:53 -0400
commiteadad7311777c68cf7daa55e267b296573466b8a (patch)
tree6cd384a16198f24401fcf0cb0edef39e44175311 /Emby.Server.Implementations/ApplicationHost.cs
parent123bfbcf19a06bc45f13ff0c25b1f34a5d9f94b8 (diff)
parent5a816f0b22cec12d193b19fcb9f21c7d085a3fbf (diff)
Merge branch 'master' into use-development-exception-page
Diffstat (limited to 'Emby.Server.Implementations/ApplicationHost.cs')
-rw-r--r--Emby.Server.Implementations/ApplicationHost.cs18
1 files changed, 6 insertions, 12 deletions
diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs
index 4fbc933a8..c959cc974 100644
--- a/Emby.Server.Implementations/ApplicationHost.cs
+++ b/Emby.Server.Implementations/ApplicationHost.cs
@@ -43,6 +43,7 @@ using Emby.Server.Implementations.Playlists;
using Emby.Server.Implementations.ScheduledTasks;
using Emby.Server.Implementations.Security;
using Emby.Server.Implementations.Serialization;
+using Emby.Server.Implementations.Services;
using Emby.Server.Implementations.Session;
using Emby.Server.Implementations.SocketSharp;
using Emby.Server.Implementations.TV;
@@ -758,6 +759,7 @@ namespace Emby.Server.Implementations
CertificateInfo = GetCertificateInfo(true);
Certificate = GetCertificate(CertificateInfo);
+ serviceCollection.AddSingleton<ServiceController>();
serviceCollection.AddSingleton<IHttpListener, WebSocketSharpListener>();
serviceCollection.AddSingleton<IHttpServer, HttpListenerHost>();
@@ -1063,7 +1065,7 @@ namespace Emby.Server.Implementations
.Where(i => i != null)
.ToArray();
- HttpServer.Init(GetExports<IService>(false), GetExports<IWebSocketListener>(), GetUrlPrefixes());
+ HttpServer.Init(GetExportTypes<IService>(), GetExports<IWebSocketListener>(), GetUrlPrefixes());
LibraryManager.AddParts(
GetExports<IResolverIgnoreRule>(),
@@ -1507,18 +1509,10 @@ namespace Emby.Server.Implementations
public string GetLocalApiUrl(ReadOnlySpan<char> host)
{
var url = new StringBuilder(64);
- if (EnableHttps)
- {
- url.Append("https://");
- }
- else
- {
- url.Append("http://");
- }
-
- url.Append(host)
+ url.Append(EnableHttps ? "https://" : "http://")
+ .Append(host)
.Append(':')
- .Append(HttpPort);
+ .Append(EnableHttps ? HttpsPort : HttpPort);
string baseUrl = ServerConfigurationManager.Configuration.BaseUrl;
if (baseUrl.Length != 0)