Skip to content

Commit

Permalink
Fix issue with language routing
Browse files Browse the repository at this point in the history
- None of the routings on the Index() function of the controller were triggering.
- Moved the routings to class level instead.
  • Loading branch information
Italo Cotta committed Feb 24, 2022
1 parent b2ac945 commit 9404812
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
namespace Geta.Optimizely.Sitemaps.Controllers
{
[Route("sitemap.xml")]
[Route("{path}sitemap.xml", Name = "Sitemap with path")]
[Route("{language}/sitemap.xml", Name = "Sitemap with language")]
[Route("{language}/{path}/sitemap.xml", Name = "Sitemap with language and path")]
public class GetaSitemapController : Controller
{
private readonly ISitemapRepository _sitemapRepository;
Expand All @@ -40,10 +43,6 @@ public GetaSitemapController(
_configuration = options.Value;
}

[Route("", Name = "Sitemap without path")]
[Route("{path}sitemap.xml", Name = "Sitemap with path")]
[Route("{language}/sitemap.xml", Name = "Sitemap with language")]
[Route("{language}/{path}sitemap.xml", Name = "Sitemap with language and path")]
public ActionResult Index()
{
var sitemapData = _sitemapRepository.GetSitemapData(Request.GetDisplayUrl());
Expand Down

0 comments on commit 9404812

Please sign in to comment.