Fix host and port handling for published server URI overrides

This commit is contained in:
WizardOfYendor1
2026-07-10 14:19:08 -04:00
parent 53aafcd38e
commit ce43df6f43
3 changed files with 71 additions and 17 deletions
@@ -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('/');
}