mirror of
https://github.com/Cleanuparr/Cleanuparr.git
synced 2026-10-03 16:36:34 -04:00
Redirect to base path from root path (#466)
This commit is contained in:
1 parent
8a2aca79f7
commit
df986a2e36
1 file changed
+7
@@ -131,6 +131,13 @@ if (basePath is not null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(basePath) && !context.Request.Path.StartsWithSegments(basePath, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
// Redirect root to the base path for convenience
|
||||
if (!context.Request.Path.HasValue || context.Request.Path.Value == "/")
|
||||
{
|
||||
context.Response.Redirect(basePath + "/");
|
||||
return;
|
||||
}
|
||||
|
||||
context.Response.StatusCode = StatusCodes.Status404NotFound;
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user