瀏覽代碼

Fix GetLocalApiUrl for cases with https enabled

This should fix LiveTV and tuners
Vasily 5 年之前
父節點
當前提交
bece62fd5c
共有 1 個文件被更改,包括 3 次插入11 次删除
  1. 3 11
      Emby.Server.Implementations/ApplicationHost.cs

+ 3 - 11
Emby.Server.Implementations/ApplicationHost.cs

@@ -1507,18 +1507,10 @@ namespace Emby.Server.Implementations
         public string GetLocalApiUrl(ReadOnlySpan<char> host)
         public string GetLocalApiUrl(ReadOnlySpan<char> host)
         {
         {
             var url = new StringBuilder(64);
             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(':')
-                .Append(HttpPort);
+                .Append(EnableHttps ? HttpsPort : HttpPort);
 
 
             string baseUrl = ServerConfigurationManager.Configuration.BaseUrl;
             string baseUrl = ServerConfigurationManager.Configuration.BaseUrl;
             if (baseUrl.Length != 0)
             if (baseUrl.Length != 0)