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

The Rewrite middleware changes middleware ordering #57987

Open
1 task done
benjaminpetit opened this issue Sep 20, 2024 · 0 comments
Open
1 task done

The Rewrite middleware changes middleware ordering #57987

benjaminpetit opened this issue Sep 20, 2024 · 0 comments
Labels
area-middleware Includes: URL rewrite, redirect, response cache/compression, session, and other general middlesware

Comments

@benjaminpetit
Copy link
Member

Is there an existing issue for this?

  • 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: microsoft/reverse-proxy#2532

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-middleware Includes: URL rewrite, redirect, response cache/compression, session, and other general middlesware label Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-middleware Includes: URL rewrite, redirect, response cache/compression, session, and other general middlesware
Projects
None yet
Development

No branches or pull requests

1 participant