Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CmsKit - Not Found pages triggers infinite loop - ERR_TOO_MANY_REDIRECTS #17279

Closed
1 task done
enisn opened this issue Aug 4, 2023 · 4 comments
Closed
1 task done

Comments

@enisn
Copy link
Member

enisn commented Aug 4, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Description

as an example, browser tries to load the following file /__bundles/bootstrap.min.css.map and infinite redirection loop starts.
image

image

When I remove CmsKit Global Features;

GlobalFeatureManager.Instance.Modules.CmsKit(cmsKit =>
{
    //cmsKit.EnableAll();
});

everything works as expected and there is no problem

Reproduction Steps

No response

Expected behavior

No response

Actual behavior

No response

Regression?

No response

Known Workarounds

No response

Version

7.3.1

User Interface

Common (Default)

Database Provider

None/Others

Tiered or separate authentication server

None (Default)

Operation System

Windows (Default)

Other information

No response

@enisn enisn added this to the 7.3-patch milestone Aug 4, 2023
@enisn enisn self-assigned this Aug 4, 2023
@enisn
Copy link
Member Author

enisn commented Aug 4, 2023

Also, CmsKit tries to handle /Error page and redirection loop is triggered again

image

@enisn
Copy link
Member Author

enisn commented Aug 4, 2023

Found the problem:

options.Conventions.AddPageRoute("/Public/CmsKit/Pages/Index", PageConsts.UrlPrefix + "{slug:minlength(1)}");

The pattern above captures all paths that are not matched any route from routing, and also handles (Not Found - 404) too since it matches anything with min length 1.

Workaround

Changing pages url prefix in PreConfigureServices prevents handling everyting

public override void PreConfigureServices(ServiceConfigurationContext context)
{
    PageConsts.UrlPrefix = "pages/";
}

@enisn
Copy link
Member Author

enisn commented Aug 8, 2023

I think we can handle requests in a middleware instead registering all routes that starts with /

Like here:
https://github.com/volosoft/volo/blob/e5fae8331664a8e8596b499de02d0c6718a608a4/abp/cms-kit-pro/src/Volo.CmsKit.Pro.Public.Web/Middlewares/UrlShortingMiddleware.cs#L23

@enisn
Copy link
Member Author

enisn commented Aug 8, 2023

There is no quick fix without a breaking-change,
So, I'm closing this issue since it will be solved with #17319 in the 8.0 milestone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant