We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 360cf78 commit 2b63a5fCopy full SHA for 2b63a5f
src/Http/Http/src/Builder/ApplicationBuilder.cs
@@ -132,6 +132,9 @@ public RequestDelegate Build()
132
throw new InvalidOperationException(message);
133
}
134
135
+ // Flushing the response and calling through to the next middleware in the pipeline is
136
+ // a user error, but don't attempt to set the status code if this happens. It leads to a confusing
137
+ // behavior where the client response looks fine, but the server side logic results in an exception.
138
if (!context.Response.HasStarted)
139
{
140
context.Response.StatusCode = StatusCodes.Status404NotFound;
0 commit comments