-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Open
Labels
analyzerIndicates an issue which is related to analyzer experienceIndicates an issue which is related to analyzer experiencearea-middlewareIncludes: URL rewrite, redirect, response cache/compression, session, and other general middlewaresIncludes: URL rewrite, redirect, response cache/compression, session, and other general middlewaresarea-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
Milestone
Description
Is there an existing issue for this?
- I have searched the existing issues
Is your feature request related to a problem? Please describe the problem.
Some middleware is terminal. That means it doesn't call the next middleware (if present) and starts the request returning back down the pipeline. For example, UseSpa
is terminal.
Developers could place middleware after UseSpa
, not realizing it isn't executed. For example, UseEndpoints
after UseSpa
.
This problem also happens with WebApplication
, which implicitly adds UseEndpoints
to the end of the pipeline. Any terminal middleware prevents endpoints from being executed.
Describe the solution you'd like
- Detect middleware after terminal middleware and warn the developer.
- (maybe) Detect terminal middleware with
WebApplication
. Warn the developer they may need to add UseEndpoints before terminal middleware.
Additional context
No response
juliushardt, richstokoe and inkysquid
Metadata
Metadata
Assignees
Labels
analyzerIndicates an issue which is related to analyzer experienceIndicates an issue which is related to analyzer experiencearea-middlewareIncludes: URL rewrite, redirect, response cache/compression, session, and other general middlewaresIncludes: URL rewrite, redirect, response cache/compression, session, and other general middlewaresarea-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions