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

Add ReasonPhrase to HttpResponse #395

Closed
davidfowl opened this issue Sep 10, 2015 · 5 comments
Closed

Add ReasonPhrase to HttpResponse #395

davidfowl opened this issue Sep 10, 2015 · 5 comments

Comments

@davidfowl
Copy link
Member

Because this code
response.HttpContext.Features.Get<IHttpResponseFeature>().ReasonPhrase = null; is ridiculous

@Tratcher
Copy link
Member

No, it's useless &/ obsolete.

The servers will set the reason phrase based on the status code. The application should only ever consider setting it if they are defining custom status codes, and even then it's optional. Most users just set it to the default values anyways.

HTTP/2 has removed this field.

@muratg muratg changed the title Add ReasonPhrash to HttpResponse Add ReasonPhrase to HttpResponse Sep 11, 2015
@muratg
Copy link

muratg commented Sep 14, 2015

@davidfowl Why do we need this?

@davidfowl
Copy link
Member Author

If we think nobody needs to use it I'm ok punting. As I said:

response.HttpContext.Features.Get<IHttpResponseFeature>().ReasonPhrase = null

Is ridiculous. We pretty much expose everything else on the IHttpResponseFeature.

@Tratcher
Copy link
Member

The features are complete / raw protocol, where HttpContext is about convenience. It is part of the protocol, but we have reasons for not making it convenient.

@davidfowl
Copy link
Member Author

Cool. Closing this out until somebody asks for it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants