Skip to content

[Route Groups] Implement IApplicationBuilder to support grouped middleware #41431

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

Open
halter73 opened this issue Apr 28, 2022 · 1 comment
Open
Labels
area-minimal Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc
Milestone

Comments

@halter73
Copy link
Member

halter73 commented Apr 28, 2022

We want MapGroup to support middleware via the IApplicationBuilder interface so things like UseResponseCompression(), UseHttpLogging(), UseForwardedHeaders(), UseRequestLocalization(), terminal middleware like UseStaticFiles() and more can be called on a group.

Describe the solution you'd like

This still needs design, but there are a lot of open questions. We still need to figure out how we define a middleware that runs every time a route handler in a given group is hit. before running the endpoint and similar middleware from inner groups?

  • How do we deal with middleware that checks the request path?
    • Can we trim the group prefix from the path?
  • What about middleware that's aware of grouping and wants the real full path?
  • What if no endpoint is matched, but the middleware would have been terminal?
    • Do we create a low-priority catchall endpoint with the route prefix?
  • Then what if the middleware isn't terminal?
    • Can we still fallback to the normal missing endpoint logic if we add a fake catchall endpoint?
  • Will we support middleware rewriting the route after matching a specific group prefix and rerun routing?
    • This seems like too much. What if the new
@halter73 halter73 added the old-area-web-frameworks-do-not-use *DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels label Apr 28, 2022
@halter73 halter73 mentioned this issue Apr 28, 2022
4 tasks
@halter73 halter73 added this to the .NET 7 Planning milestone May 3, 2022
@ghost
Copy link

ghost commented May 3, 2022

Thanks for contacting us.

We're moving this issue to the .NET 7 Planning milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@captainsafia captainsafia added area-minimal Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc and removed old-area-web-frameworks-do-not-use *DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels labels Jun 6, 2023
@captainsafia captainsafia modified the milestones: .NET 8 Planning, Backlog Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-minimal Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc
Projects
None yet
Development

No branches or pull requests

3 participants