From 7239141181bb4498c3bbb4cb03dcac75729af9ff Mon Sep 17 00:00:00 2001 From: Shadowghost Date: Fri, 7 Oct 2022 08:43:17 +0200 Subject: [PATCH] Apply review suggestions --- Jellyfin.Server/Middleware/BaseUrlRedirectionMiddleware.cs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Jellyfin.Server/Middleware/BaseUrlRedirectionMiddleware.cs b/Jellyfin.Server/Middleware/BaseUrlRedirectionMiddleware.cs index 61b9c6f06e..4fbbeadf65 100644 --- a/Jellyfin.Server/Middleware/BaseUrlRedirectionMiddleware.cs +++ b/Jellyfin.Server/Middleware/BaseUrlRedirectionMiddleware.cs @@ -68,13 +68,8 @@ namespace Jellyfin.Server.Middleware // Always redirect back to the default path if the base prefix is invalid or missing _logger.LogDebug("Normalizing an URL at {LocalPath}", localPath); - if (string.IsNullOrWhiteSpace(baseUrlPrefix) || baseUrlPrefix[^1] != '/') - { - baseUrlPrefix += "/"; - } - var uri = new Uri(localPath); - var redirectUri = new Uri(baseUrlPrefix + _configuration[DefaultRedirectKey]); + var redirectUri = new Uri(baseUrlPrefix + "/" + _configuration[DefaultRedirectKey]); var target = uri.MakeRelativeUri(redirectUri).ToString(); _logger.LogDebug("Redirecting to {Target}", target);