소스 검색

Merge pull request #6871 from cvium/fix_localapiurl

Cody Robibero 3 년 전
부모
커밋
752bb88445
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      Emby.Server.Implementations/ApplicationHost.cs

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

@@ -1128,12 +1128,12 @@ namespace Emby.Server.Implementations
         }
         }
 
 
         /// <inheritdoc/>
         /// <inheritdoc/>
-        public string GetApiUrlForLocalAccess(bool allowHttps)
+        public string GetApiUrlForLocalAccess(bool allowHttps = true)
         {
         {
             // With an empty source, the port will be null
             // With an empty source, the port will be null
             string smart = NetManager.GetBindInterface(string.Empty, out _);
             string smart = NetManager.GetBindInterface(string.Empty, out _);
-            var scheme = allowHttps ? Uri.UriSchemeHttps : Uri.UriSchemeHttp;
-            var port = allowHttps ? HttpsPort : HttpPort;
+            var scheme = !allowHttps ? Uri.UriSchemeHttp : null;
+            int? port = !allowHttps ? HttpPort : null;
             return GetLocalApiUrl(smart.Trim('/'), scheme, port);
             return GetLocalApiUrl(smart.Trim('/'), scheme, port);
         }
         }