Skip to content

[release/6.0-rc1] Update middleware that assumes UseRouting is called after them, for minimal hosting#35635

Merged
wtgodbe merged 14 commits into
release/6.0-rc1from
backport/pr-35426-to-release/6.0-rc1
Aug 24, 2021
Merged

[release/6.0-rc1] Update middleware that assumes UseRouting is called after them, for minimal hosting#35635
wtgodbe merged 14 commits into
release/6.0-rc1from
backport/pr-35426-to-release/6.0-rc1

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented Aug 23, 2021

Backport of #35426 to release/6.0-rc1

/cc @BrennanConroy

Customer Impact

When using the new "minimal hosting" (WebApplicationBuilder/WebApplication), UseRouting() is implicitly called for you which causes issues if you try to use one of the middleware that should run before UseRouting (middleware order). If you hit this scenario where you use one of these middleware without calling UseRouting it will silently not work. This fixes it so the middleware will work in the WebApplication case without the user calling UseRouting.

Testing

Lots of new tests for both new and old scenarios

Risk

Low, test coverage is good, manual testing done as well.

BrennanConroy and others added 3 commits August 23, 2021 16:51
Co-authored-by: Stephen Halter <halter73@gmail.com>
Comment thread src/Middleware/Rewrite/src/RewriteBuilderExtensions.cs Outdated
@Pilchie Pilchie added the Servicing-consider Shiproom approval is required for the issue label Aug 24, 2021
@ghost
Copy link
Copy Markdown

ghost commented Aug 24, 2021

Hello human! Please make sure you've included the Shiproom Template in a comment or (preferably) the PR description. Also, make sure this PR is not marked as a draft and is ready-to-merge.

@BrennanConroy BrennanConroy added Servicing-approved Shiproom has approved the issue and removed Servicing-consider Shiproom approval is required for the issue labels Aug 24, 2021
Copy link
Copy Markdown
Member

@BrennanConroy BrennanConroy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait for my approval

@BrennanConroy
Copy link
Copy Markdown
Member

@dotnet/aspnet-build merge please 😃

@wtgodbe wtgodbe merged commit d455df3 into release/6.0-rc1 Aug 24, 2021
@wtgodbe wtgodbe deleted the backport/pr-35426-to-release/6.0-rc1 branch August 24, 2021 19:53
@ghost ghost added this to the 6.0-rc1 milestone Aug 24, 2021
@amcasey amcasey added area-middleware Includes: URL rewrite, redirect, response cache/compression, session, and other general middlewares and removed area-runtime labels Jun 6, 2023
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 middlewares Servicing-approved Shiproom has approved the issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants