You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 20, 2018. It is now read-only.
On IHttpResponseFeature and HttpResponse there is a HeadersSent property. The name is somewhat misleading though. 1. It's not just the headers, the status code and reason phrase are also sent, and 2. for Helios (and soon WebListener) there is write-behind buffering such that the response is not actually sent, but the status code and headers can no longer be modified.
Proposal: Rename HeadersSent to HasStarted, e.g. context.Response.HasStarted.
Here's the current flow:
First Write/Flush
Fire OnSendingHeaders
Set HasStarted = true
Make the response StatusCode, ReasonPhrase, and Headers read-only
Send (or write-behind buffer) the Write.
Related: Should OnSendingHeaders similarly be renamed to OnResponseStarting or OnStarting? Compare to the OnResponseCompleted event.
The text was updated successfully, but these errors were encountered:
I recommend OnResponseStarting over Started as this event is your last chance to make modifications. Once it HasStarted the response fields become read-only. Note that before it was OnSendingHeaders, not OnHeadersSent.
On
IHttpResponseFeature
andHttpResponse
there is aHeadersSent
property. The name is somewhat misleading though. 1. It's not just the headers, the status code and reason phrase are also sent, and 2. for Helios (and soon WebListener) there is write-behind buffering such that the response is not actually sent, but the status code and headers can no longer be modified.Proposal: Rename
HeadersSent
toHasStarted
, e.g.context.Response.HasStarted
.Here's the current flow:
Related: Should
OnSendingHeaders
similarly be renamed toOnResponseStarting
orOnStarting
? Compare to theOnResponseCompleted
event.The text was updated successfully, but these errors were encountered: