Skip to content

Commit

Permalink
Expand Downloads redirect.
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbound committed Apr 22, 2021
1 parent 35769b2 commit 6ee5300
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Server/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,8 @@ private static void ConfigureStaticFiles(IApplicationBuilder app, IWebHostEnviro
app.Use(async (context, next) =>
{
if (context.Request.Path.HasValue &&
context.Request.Path.Value.Contains("/Downloads/R", StringComparison.OrdinalIgnoreCase))
context.Request.Path.Value.Contains("/Downloads/", StringComparison.OrdinalIgnoreCase) &&
!context.Request.Path.Value.TrimEnd('/').EndsWith("downloads", StringComparison.OrdinalIgnoreCase))
{
var redirectUrl = context.Request.GetDisplayUrl().Replace("/Downloads/", "/Content/");
context.Response.Redirect(redirectUrl);
Expand Down

0 comments on commit 6ee5300

Please sign in to comment.