Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HttpResponse body infrastructure changes #14832

Closed
BrennanConroy opened this issue Sep 30, 2019 · 0 comments · Fixed by #15044
Closed

HttpResponse body infrastructure changes #14832

BrennanConroy opened this issue Sep 30, 2019 · 0 comments · Fixed by #15044
Assignees
Labels
breaking-change Indicates a .NET Core breaking change

Comments

@BrennanConroy
Copy link
Member

HttpResponse body infrastructure changes

The infrastructure backing HttpResponse bodies has changed. If you're using HttpResponse directly you should not need to make any code changes. Read further if you were wrapping or replacing HttpResponse.Body or accessing HttpContext.Features.

Version introduced

3.0

Old behavior

There were three APIs associated with the response body: IHttpResponseFeature.Body, IHttpSendFileFeature.SendFileAsync, and IHttpBufferingFeature.DisableResponseBuffering

New behavior

In ASP.NET Core if you replace HttpResponse.Body it will now replace the entire IHttpResponseBodyFeature with a wrapper around your given stream using StreamResponseBodyFeature to provide default implementations for all of the expected APIs. Setting back the original stream will undo this change.

Reason for change

Consolidating the response body APIs onto a single new feature interface.

Recommended action

Use IHttpResponseBodyFeature where you previously were using IHttpResponseFeature.Body,
IHttpSendFileFeature, or IHttpBufferingFeature.

Category

ASP.NET Core

Affected APIs

IHttpResponseFeature.Body
IHttpSendFileFeature
IHttpBufferingFeature


Issue metadata

  • Issue type: breaking-change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change Indicates a .NET Core breaking change
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants