The Rewrite middleware changes middleware ordering
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 281
Description
### Is there an existing issue for this?
- [X] I have searched the existing issues
### Describe the bug
When the URL has been modified by the rewrite middleware, it will force to run the routing middleware just after, disregarding the order configured by the developer.
This is an issue because routing might find a suitable endpoint before we had a chance to execute any other middleware (like the static file middleware).
### Expected Behavior
The rewrite middleware doesn't change the middleware order when the URL has been modified.
### Steps To Reproduce
Good repro here from @sgarnovsky https://github.com/sgarnovsky/AspNetCoreIssues/tree/main/BlazorAppUrlRewritingTest
### Exceptions (if any)
_No response_
### .NET Version
8
### Anything else?
Related issue: https://github.com/microsoft/reverse-proxy/issues/2532
Contributor guide
Assessment
This issue has not been assessed yet.