Fix redirect logic if request path is exactly the base url
This commit is contained in:
parent
3ee0c68cb7
commit
a7585dd2d6
|
@ -58,9 +58,12 @@ namespace Jellyfin.Server.Middleware
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!startsWithBaseUrl)
|
if (!startsWithBaseUrl
|
||||||
|
|| localPath.Equals(baseUrlPrefix, StringComparison.OrdinalIgnoreCase)
|
||||||
|
// Local path is /baseUrl/
|
||||||
|
|| (localPath.Length == baseUrlPrefix.Length + 1 && localPath[^1] == '/'))
|
||||||
{
|
{
|
||||||
// Always redirect back to the default path if the base prefix is invalid or missing
|
// Always redirect back to the default path if the base prefix is invalid, missing, or is the full path.
|
||||||
_logger.LogDebug("Normalizing an URL at {LocalPath}", localPath);
|
_logger.LogDebug("Normalizing an URL at {LocalPath}", localPath);
|
||||||
httpContext.Response.Redirect(baseUrlPrefix + "/" + _configuration[ConfigurationExtensions.DefaultRedirectKey]);
|
httpContext.Response.Redirect(baseUrlPrefix + "/" + _configuration[ConfigurationExtensions.DefaultRedirectKey]);
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user