Fix typo (#32075)
parent
85a7362809
commit
522a950002
|
@ -52,10 +52,10 @@ Chain multiple request delegates together with <xref:Microsoft.AspNetCore.Builde
|
|||
When a delegate doesn't pass a request to the next delegate, it's called *short-circuiting the request pipeline*. Short-circuiting is often desirable because it avoids unnecessary work. For example, [Static File Middleware](xref:fundamentals/static-files) can act as a *terminal middleware* by processing a request for a static file and short-circuiting the rest of the pipeline. Middleware added to the pipeline before the middleware that terminates further processing still processes code after their `next.Invoke` statements. However, see the following warning about attempting to write to a response that has already been sent.
|
||||
|
||||
> [!WARNING]
|
||||
> Don't call `next.Invoke` after the response has been sent to the client. Changes to <xref:Microsoft.AspNetCore.Http.HttpResponse> after the response has started throw an exception. For example, [setting headers and a status code throw an exception](xref:fundamentals/best-practices#do-not-modify-the-status-code-or-headers-after-the-response-body-has-started). Writing to the response body after calling `next`:
|
||||
> Don't call `next.Invoke` during or after the response has been sent to the client. After an <xref:Microsoft.AspNetCore.Http.HttpResponse> has started, changes result in an exception. For example, [setting headers and a status code throw an exception](xref:fundamentals/best-practices#do-not-modify-the-status-code-or-headers-after-the-response-body-has-started) after the response starts. Writing to the response body after calling `next`:
|
||||
>
|
||||
> * May cause a protocol violation. For example, writing more than the stated `Content-Length`.
|
||||
> * May corrupt the body format. For example, writing an HTML footer to a CSS file.
|
||||
> * May cause a protocol violation, such as writing more than the stated `Content-Length`.
|
||||
> * May corrupt the body format, such as writing an HTML footer to a CSS file.
|
||||
>
|
||||
> <xref:Microsoft.AspNetCore.Http.HttpResponse.HasStarted%2A> is a useful hint to indicate if headers have been sent or the body has been written to.
|
||||
|
||||
|
|
Loading…
Reference in New Issue