Repository navigation
Conversation
Middleware registered before the status code pages middleware doesn't run again when a request is re-executed, so UseRateLimiter must come after UseStatusCodePagesWithReExecute for endpoint policies to apply to the re-executed endpoint. Fixes dotnet/aspnetcore#69942
Collaborator
|
Thanks, @GrantTotinov! 🚀
|
Contributor
Author
|
@guardrex Done! Ive applied all the requested changes, including updating the 8.0 and 9.0 includes. Thanks for the review! |
guardrex
approved these changes
Oct 23, 2026
Collaborator
|
Thanks, @GrantTotinov! 🚀 The changes will probably go live in a few hours. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes dotnet/aspnetcore#69942
When
UseStatusCodePagesWithReExecuteis registered afterUseRateLimiter, re-execution skips the rate limiter, so the re-executed endpoint's rate limiting policy isn't applied.Changes:
rate-limit.md: added a note and ordering example after the existingUseRoutingguidance.error-handling.md(.NET 10+): explained that middleware registered before the status code pages middleware doesn't run again during re-execution, with the same example.I checked the behavior with a small .NET 10 app (fixed window policy,
PermitLimit = 1, on/b;/areturns an empty 404):/b/b/aUseRouting,UseRateLimiter,UseStatusCodePagesWithReExecute("/b")/b(limiter bypassed)UseStatusCodePagesWithReExecute("/b"),UseRouting,UseRateLimiterI left the 8.0 and 9.0 includes unchanged to keep this small. Happy to add the same note there if you'd like.
Internal previews
Build report