Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Commit

Permalink
Fix - ASCII characters not enforced in product SeName/slug #670
Browse files Browse the repository at this point in the history
  • Loading branch information
KrzysztofPajak committed Nov 20, 2019
1 parent 0cfa81c commit 7f7fe6d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Expand Up @@ -20,6 +20,7 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.DataProtection;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.ApplicationParts;
using Microsoft.AspNetCore.Mvc.Infrastructure;
using Microsoft.AspNetCore.Mvc.Razor;
Expand Down Expand Up @@ -340,7 +341,7 @@ public static void AddGrandMiniProfiler(this IServiceCollection services)
public static void AddGrandRedirectResultExecutor(this IServiceCollection services)
{
//we use custom redirect executor as a workaround to allow using non-ASCII characters in redirect URLs
services.AddSingleton<RedirectResultExecutor, GrandRedirectResultExecutor>();
services.AddSingleton<IActionResultExecutor<RedirectResult>, GrandRedirectResultExecutor>();
}

public static void AddSettings(this IServiceCollection services)
Expand Down
2 changes: 2 additions & 0 deletions Grand.Framework/Seo/GenericPathRoute.cs
Expand Up @@ -117,6 +117,7 @@ public override async Task RouteAsync(RouteContext context)
context.HttpContext.Items["grand.RedirectFromGenericPathRoute"] = true;
context.RouteData = redirectionRouteData;
await _target.RouteAsync(context);
return;
}

//ensure that the slug is the same for the current language,
Expand All @@ -136,6 +137,7 @@ public override async Task RouteAsync(RouteContext context)
context.HttpContext.Items["grand.RedirectFromGenericPathRoute"] = true;
context.RouteData = redirectionRouteData;
await _target.RouteAsync(context);
return;
}

//since we are here, all is ok with the slug, so process URL
Expand Down

0 comments on commit 7f7fe6d

Please sign in to comment.