mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 05:47:14 -04:00
Only force scheme and port when HTTPS is disallowed
This commit is contained in:
parent
0009e5cc27
commit
a263f3978b
@ -1128,12 +1128,12 @@ namespace Emby.Server.Implementations
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public string GetApiUrlForLocalAccess(bool allowHttps)
|
public string GetApiUrlForLocalAccess(bool allowHttps = true)
|
||||||
{
|
{
|
||||||
// With an empty source, the port will be null
|
// With an empty source, the port will be null
|
||||||
string smart = NetManager.GetBindInterface(string.Empty, out _);
|
string smart = NetManager.GetBindInterface(string.Empty, out _);
|
||||||
var scheme = allowHttps ? Uri.UriSchemeHttps : Uri.UriSchemeHttp;
|
var scheme = !allowHttps ? Uri.UriSchemeHttp : null;
|
||||||
var port = allowHttps ? HttpsPort : HttpPort;
|
int? port = !allowHttps ? HttpPort : null;
|
||||||
return GetLocalApiUrl(smart.Trim('/'), scheme, port);
|
return GetLocalApiUrl(smart.Trim('/'), scheme, port);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user