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

Pipeline is rejoined only if middleware does not short-circuit #33662

Open
bravequickcleverfibreyarn opened this issue Sep 19, 2024 · 2 comments

Comments

@bravequickcleverfibreyarn
Copy link
Contributor

Description

From https://learn.microsoft.com/en-us/aspnet/core/fundamentals/middleware/?view=aspnetcore-8.0#branch-the-middleware-pipeline

UseWhen also branches the request pipeline based on the result of the given predicate. Unlike with MapWhen, this branch is rejoined to the main pipeline if it doesn't short-circuit or contain a terminal middleware:

From https://learn.microsoft.com/en-us/aspnet/core/fundamentals/middleware/?view=aspnetcore-8.0

When a middleware short-circuits, it's called a terminal middleware because it prevents further middleware from processing the request.

Thus, as I understand, there has to be either "doesn't short-circuit" or "contain a terminal middleware" but no both.

Page URL

https://learn.microsoft.com/en-us/aspnet/core/fundamentals/middleware/?view=aspnetcore-8.0

Content source URL

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/fundamentals/middleware/index.md

Document ID

3926c686-0ccc-f9fe-ca52-0134612a1623

Article author

@tdykstra

@tdykstra
Copy link
Contributor

@bravequickcleverfibreyarn What change to the text would you propose to fix this?

@bravequickcleverfibreyarn
Copy link
Contributor Author

I would propose:

  • either "if it doesn't short-circuit:"
  • or " if it doesn't contain a terminal middleware:"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants