Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Thobias 4 posts 74 karma points
    Aug 17, 2023 @ 10:34
    Thobias
    0

    SEOChecker and Umbraco Forms are not working together - duplicated endpoint

    I get stuck on something weird behavior.

    SEOChecker: 10.0.4 Umbraco: 10.5 Umbraco Forms: 10.2

    The problem is, the POST request ended in an exception.

    InvalidOperationException: The following endpoints with a duplicate endpoint name were found.
    
    Endpoints with endpoint name 'robotstxtroute':
    Route: robots.txt
    Route: robots.txt
    
    Endpoints with endpoint name 'xmlsitemaproute':
    Route: sitemap.xml
    Route: sitemap.xml
    
    Endpoints with endpoint name 'xmlsitemaplocaleroute':
    Route: {localePath}/sitemap.xml
    Route: {localePath}/sitemap.xml
    
    Endpoints with endpoint name 'sitemapindexroute':
    Route: sitemapindex.xml
    Route: sitemapindex.xml
    

    The controller eg. "SEOCheckerRobotsTxtController" is added twice on a POST request, found by debugging EndpointNameAddressScheme.Initialize() method.

    I figured out that this is happening when the "ufprt" is given in the payload.

    This error is shown on BeginUmbracoForm with a SurfaceController as action too.

    Has anyone an idea?

  • Richard Soeteman 4054 posts 12927 karma points MVP 2x
    Aug 23, 2023 @ 06:54
    Richard Soeteman
    0

    Hi,

    Not sure what to do? I register this once during startup of the app.

  • Thobias 4 posts 74 karma points
    Aug 23, 2023 @ 07:54
    Thobias
    0

    What exactly do you register during startup?

  • Richard Soeteman 4054 posts 12927 karma points MVP 2x
    Aug 23, 2023 @ 07:57
    Richard Soeteman
    0

    Using a composer in Umbraco this is registered

      applicationBuilder.UseEndpoints(endpoints =>
                    {
                        endpoints.MapControllerRoute(
                          "robotstxtroute",
                          "robots.txt",
                          new { Controller = "SEOCheckerRobotsTxt", Action = "Index" });
    
    
                        endpoints.MapControllerRoute(
                            "xmlsitemaproute",
                            "sitemap.xml",
                            new { Controller = "SEOCheckerXmlSitemap", Action = "Index" });
    
                        endpoints.MapControllerRoute(
                          "xmlsitemaplocaleroute",
                          "{localePath}/sitemap.xml",
                          new { Controller = "SEOCheckerXmlSitemap", Action = "Index" });
    
                        endpoints.MapControllerRoute(
                         "sitemapindexroute",
                         "sitemapindex.xml",
                         new { Controller = "SEOCheckerXmlSitemap", Action = "FileIndex" });
                    });
    
  • Thobias 4 posts 74 karma points
    Aug 23, 2023 @ 08:06
    Thobias
    0

    I tried this but the same error again.

    Did you test it with Umbraco Forms and submit a form?

  • Richard Soeteman 4054 posts 12927 karma points MVP 2x
    Aug 23, 2023 @ 08:22
    Richard Soeteman
    0

    I just did,

    No errors on submit, no errors in log.

  • Thobias 4 posts 74 karma points
    Aug 23, 2023 @ 08:30
    Thobias
    0

    I figured out, what is causing the problem.

    The problem was i used the WidthMiddleware instead of WithCustomMiddleware.

    .WithCustomMiddleware(u =>
                {
                    u.RunPrePipeline();
                    u.RegisterDefaultRequiredMiddleware();
                    u.RunPostPipeline();
                    u.UseBackOffice();
                    u.UseWebsite();
                })
    

    WithMiddleware is calling Pre and Post pipelines aswell, WithCustomMiddle not.

    Thanks

  • Richard Soeteman 4054 posts 12927 karma points MVP 2x
    Aug 23, 2023 @ 08:32
    Richard Soeteman
    0

    Great it's solved

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies