aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations
diff options
context:
space:
mode:
authorWizardOfYendor1 <WizardOfYendor1@users.noreply.github.com>2026-07-10 14:19:08 -0400
committerWizardOfYendor1 <WizardOfYendor1@users.noreply.github.com>2026-07-10 14:19:08 -0400
commitce43df6f43b851e7b09dd6b91ed52a3335feb7a2 (patch)
tree8fc371c02a9adbaea84a82061caaa884a941d34c /Emby.Server.Implementations
parent53aafcd38e1f4558ff18f5258d0d46b3a0565783 (diff)
Fix host and port handling for published server URI overrides
Diffstat (limited to 'Emby.Server.Implementations')
-rw-r--r--Emby.Server.Implementations/ApplicationHost.cs5
1 files changed, 3 insertions, 2 deletions
diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs
index 69e23bcb63..1b37e7498d 100644
--- a/Emby.Server.Implementations/ApplicationHost.cs
+++ b/Emby.Server.Implementations/ApplicationHost.cs
@@ -965,8 +965,9 @@ namespace Emby.Server.Implementations
/// <inheritdoc/>
public string GetLocalApiUrl(string hostname, string scheme = null, int? port = null)
{
- // If the smartAPI doesn't start with http then treat it as a host or ip.
- if (hostname.StartsWith("http", StringComparison.OrdinalIgnoreCase))
+ // If the smartAPI isn't already a complete URL then treat it as a host or ip.
+ if (hostname.StartsWith("http://", StringComparison.OrdinalIgnoreCase)
+ || hostname.StartsWith("https://", StringComparison.OrdinalIgnoreCase))
{
return hostname.TrimEnd('/');
}