From a263f3978ba47968274062f9c1bef445b4b946bd Mon Sep 17 00:00:00 2001 From: cvium Date: Fri, 19 Nov 2021 16:57:48 +0100 Subject: [PATCH] Only force scheme and port when HTTPS is disallowed --- Emby.Server.Implementations/ApplicationHost.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index 99ad9fdf48..903c311334 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -1128,12 +1128,12 @@ namespace Emby.Server.Implementations } /// - public string GetApiUrlForLocalAccess(bool allowHttps) + public string GetApiUrlForLocalAccess(bool allowHttps = true) { // With an empty source, the port will be null 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); }