瀏覽代碼

Prevent host lookup on GetSmartUrl for HTTP requests

Shadowghost 2 年之前
父節點
當前提交
577399ca05
共有 1 個文件被更改,包括 1 次插入9 次删除
  1. 1 9
      Emby.Server.Implementations/ApplicationHost.cs

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

@@ -1088,15 +1088,7 @@ namespace Emby.Server.Implementations
                 return GetLocalApiUrl(request.Host.Host, request.Scheme, requestPort);
             }
 
-            // Published server ends with a /
-            if (!string.IsNullOrEmpty(PublishedServerUrl))
-            {
-                // Published server ends with a '/', so we need to remove it.
-                return PublishedServerUrl.Trim('/');
-            }
-
-            string smart = NetManager.GetBindInterface(request, out var port);
-            return GetLocalApiUrl(smart.Trim('/'), request.Scheme, port);
+            return GetSmartApiUrl(request.HttpContext.Connection.RemoteIpAddress ?? IPAddress.Loopback);
         }
 
         /// <inheritdoc/>