Skip to content

Commit

Permalink
Fixed redirection issue where missing trailing slash caused incorrect…
Browse files Browse the repository at this point in the history
… URL redirection to root instead of the application path (#1069)

Co-authored-by: Claudia Beatriz Murialdo Garrone <c.murialdo@globant.com>
(cherry picked from commit ddb68f1)
  • Loading branch information
claudiamurialdo committed Jan 8, 2025
1 parent 2241d16 commit f0d9e1b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dotnet/src/dotnetcore/GxNetCoreStartup/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ public IActionResult Index()
string[] defaultFiles = { "default.htm", "default.html", "index.htm", "index.html" };
foreach (string file in defaultFiles) {
if (System.IO.File.Exists(Path.Combine(Startup.LocalPath, file))){
return Redirect(file);
return Redirect(Url.Content($"~/{file}"));
}
}
return Redirect(defaultFiles[0]);
Expand Down

0 comments on commit f0d9e1b

Please sign in to comment.