diff options
| author | Bond-009 <bond.009@outlook.com> | 2020-04-02 18:04:49 +0200 |
|---|---|---|
| committer | Joshua M. Boniface <joshua@boniface.me> | 2020-04-05 12:44:41 -0400 |
| commit | 3a4cd01b136e31bbdaaca293f84589852ad934e9 (patch) | |
| tree | 57a7dffde11a3d2b651b841a2ae3cd083c23aee6 | |
| parent | 7059761806f9e9efe84d19ddfc2fe27afd86d229 (diff) | |
Merge pull request #2740 from JustAMan/fix-livetv
Fix GetLocalApiUrl for cases with https enabled
(cherry picked from commit b3283e37f2ec1ee106bc135502f37f96f32954be)
Signed-off-by: Joshua M. Boniface <joshua@boniface.me>
| -rw-r--r-- | Emby.Server.Implementations/ApplicationHost.cs | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index 699997202..be4e343b4 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -1517,18 +1517,10 @@ namespace Emby.Server.Implementations public string GetLocalApiUrl(ReadOnlySpan<char> host) { var url = new StringBuilder(64); - if (EnableHttps) - { - url.Append("https://"); - } - else - { - url.Append("http://"); - } - - url.Append(host) + url.Append(EnableHttps ? "https://" : "http://") + .Append(host) .Append(':') - .Append(HttpPort); + .Append(EnableHttps ? HttpsPort : HttpPort); string baseUrl = ServerConfigurationManager.Configuration.BaseUrl; if (baseUrl.Length != 0) |
