Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Commit 6d8767d

Browse files
Tweak WebpackDevMiddleware.cs to avoid unnecessary Task.Yield()
1 parent 89034b5 commit 6d8767d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Microsoft.AspNetCore.SpaServices/Webpack/WebpackDevMiddleware.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,12 @@ public static void UseWebpackDevMiddleware(
8181
// sees, not "localhost", so that it works even when you're not running on localhost (e.g., Docker).
8282
appBuilder.Map(WebpackHotMiddlewareEndpoint, builder =>
8383
{
84-
builder.Use(next => async ctx =>
84+
builder.Use(next => ctx =>
8585
{
8686
var hostname = ctx.Request.Host.Host;
8787
ctx.Response.Redirect(
8888
$"{WebpackDevMiddlewareScheme}://{hostname}:{devServerInfo.Port.ToString()}{WebpackHotMiddlewareEndpoint}");
89-
await Task.Yield();
89+
return Task.FromResult(0);
9090
});
9191
});
9292
}

0 commit comments

Comments
 (0)