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 25, 2022
1 parent b2ac945 commit 5c74e76
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@

namespace Geta.Optimizely.Sitemaps.Controllers
{
[Route("sitemap.xml")]
[Route("sitemap.xml", Name = "Sitemap without path and/or language.")]
[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 5c74e76

Please sign in to comment.