aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/ApplicationHost.cs
diff options
context:
space:
mode:
authorcvium <clausvium@gmail.com>2021-11-08 10:58:04 +0100
committercvium <clausvium@gmail.com>2021-11-08 10:58:04 +0100
commit82e6a21f3bff6a3666a6c28d218ed936457cf5d1 (patch)
tree6eaa848800e96f1a35efe3f180d01c1e236a662d /Emby.Server.Implementations/ApplicationHost.cs
parentf03e77a4d5fa0ca81ecb11f0ffc4c14706a6dd7d (diff)
Use the new method in DLNA
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/>