소스 검색

Handle forwarded requests not having port set in GetSmartApiUrl

Shadowghost 2 년 전
부모
커밋
daf33143f6
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      Emby.Server.Implementations/ApplicationHost.cs

+ 2 - 1
Emby.Server.Implementations/ApplicationHost.cs

@@ -1080,7 +1080,8 @@ namespace Emby.Server.Implementations
             if (ConfigurationManager.GetNetworkConfiguration().EnablePublishedServerUriByRequest)
             {
                 int? requestPort = request.Host.Port;
-                if ((requestPort == 80 && string.Equals(request.Scheme, "http", StringComparison.OrdinalIgnoreCase)) || (requestPort == 443 && string.Equals(request.Scheme, "https", StringComparison.OrdinalIgnoreCase)))
+                if (((requestPort == 80 || requestPort == null) && string.Equals(request.Scheme, "http", StringComparison.OrdinalIgnoreCase))
+                || ((requestPort == 443 || requestPort == null) && string.Equals(request.Scheme, "https", StringComparison.OrdinalIgnoreCase)))
                 {
                     requestPort = -1;
                 }