Skip to content
This repository was archived by the owner on Nov 20, 2018. It is now read-only.
This repository was archived by the owner on Nov 20, 2018. It is now read-only.

Rename response.HeadersSent to response.HasStarted #320

Closed
@Tratcher

Description

@Tratcher

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions