aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/ApplicationHost.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Emby.Server.Implementations/ApplicationHost.cs')
-rw-r--r--Emby.Server.Implementations/ApplicationHost.cs9
1 files changed, 6 insertions, 3 deletions
diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs
index 7da0e2f21..4f2fdfd3c 100644
--- a/Emby.Server.Implementations/ApplicationHost.cs
+++ b/Emby.Server.Implementations/ApplicationHost.cs
@@ -1166,10 +1166,13 @@ namespace Emby.Server.Implementations
}
/// <inheritdoc/>
- public string GetApiUrlForLocalAccess()
+ public string GetApiUrlForLocalAccess(bool allowHttps)
{
- string smart = NetManager.GetBindInterface(string.Empty, out var port);
- return GetLocalApiUrl(smart.Trim('/'), null, port);
+ // 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;
+ return GetLocalApiUrl(smart.Trim('/'), scheme, port);
}
/// <inheritdoc/>