Copied to clipboard

Flag this post as spam?

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


  • codechoked 1 post 21 karma points
    Nov 16, 2022 @ 15:37
    codechoked
    0

    CORS issue after installing SEO Checker

    Hi!

    To enable CORS for one of the controllers I followed this thread https://our.umbraco.com/forum/umbraco-9/106433-enable-cors-on-umbraco-9 and got it working. But after installing SEO Checker I'm yet again struggling with CORS

    This is the details I have when calling the endpoint

    Endpoint XXX.API.Api.Controllers.BlogController.GetBlogIndex  contains CORS metadata, but a middleware was not found that supports CORS.
    Configure your application startup by adding app.UseCors() in the application startup code. If there are calls to app.UseRouting() and app.UseEndpoints(...), the call to app.UseCors() must go between them.
       at Microsoft.AspNetCore.Routing.EndpointMiddleware.ThrowMissingCorsMiddlewareException(Endpoint endpoint)
       at Microsoft.AspNetCore.Routing.EndpointMiddleware.Invoke(HttpContext httpContext)
       at SEOChecker.Common.Middleware.UrlRedirectMiddleware.InvokeAsync(HttpContext context, IContextInfo contextInfo, INiceUrlHelper niceUrlHelper, IUrlRewriteProviderFactory urlRewriteProviderFactory, IPageNotFoundRepository pageNotFoundRepository, INotFoundHelper notFoundHelper, IIOHelper ioHelper, IUriResolverService uriResolverService, IUmbracoUrlHelper umbracoUrlHelper, IUmbracoContextFactory umbracoContextFactory, IRequestProviderService requestProviderService, IConfigService1 configurationService, IOptions1 contentOptions, ILogger1 logger)
       at SEOChecker.Common.Middleware.UrlRewriteMiddleware.InvokeAsync(HttpContext context, IUrlRewriteProviderFactory urlRewriteProviderFactory, IUmbracoUrlHelper umbracoUrlHelper, IUmbracoContextFactory umbracoContextFactory, IConfigService1 configurationService, ILogger1 logger)
    

    so like nothing is registered while I can see that custom UmbracoPipelineOptions are being applied during startup.

    BlogController has [EnableCors(CORSPolicy.Name)] attribute applied.

    Any idea how SEO Checker might affect that? Uninstalling it magically makes it work again so I'm pretty sure SEO Checker is involved.

Please Sign in or register to post replies

Write your reply to:

Draft