From b7882db9c72e2a07d7814e7eaf038d69837b4972 Mon Sep 17 00:00:00 2001 From: Shadowghost Date: Fri, 21 Oct 2022 10:09:45 +0200 Subject: [PATCH] Prevent host lookup on GetSmartUrl for HTTP requests --- Emby.Server.Implementations/ApplicationHost.cs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index 909972469e..8db55a6aea 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/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); } ///