Skip to content

Conversation

campersau
Copy link
Contributor

@campersau campersau commented Jul 21, 2021

PR Title
Remove async state machines from middlewares when they do nothing

PR Description
Searched for await _next( and found a couple more in src\Http and src\Middleware

  • MapMiddleware
  • MapWhenMiddleware
  • UsePathBaseMiddleware
  • MigrationsEndPointMiddleware
  • HttpMethodOverrideMiddleware
  • ResponseCompressionMiddleware
  • SpaProxyMiddleware
  • ConditionalProxyMiddleware
  • IISMiddleware

Fixes #34574

@ghost ghost added area-runtime community-contribution Indicates that the PR has been added by a community member labels Jul 21, 2021
Copy link
Member

@Tratcher Tratcher left a comment

Choose a reason for hiding this comment

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

So far so good.

@campersau campersau force-pushed the middlewareasyncstatemachines branch from cae13b2 to ca4bbc4 Compare July 22, 2021 06:38
@Tratcher Tratcher enabled auto-merge (squash) July 22, 2021 19:54
return _next(context);
}

private async Task InvokeCore(HttpContext context, string matchedPath, string remainingPath)
Copy link
Member

Choose a reason for hiding this comment

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

In Kestrel we often use the "Awaited" suffix to indicate why we're using this patter. So this would be InvokeAwaited. I'm okay with taking this as-is though.

@Tratcher Tratcher merged commit 56d0f2a into dotnet:main Jul 23, 2021
@ghost ghost added this to the 6.0-rc1 milestone Jul 23, 2021
@campersau campersau deleted the middlewareasyncstatemachines branch July 23, 2021 04:48
@amcasey amcasey added area-middleware Includes: URL rewrite, redirect, response cache/compression, session, and other general middlewares area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions 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 area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fast path the MapMiddleware negative case
4 participants