Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Kestrel and replacing Response.Body

$
0
0

I wrote a post back in the Core 1.x-days discussing how to modify response-content via middlware–https://www.billbogaiv.com/posts/using-aspnet-cores-middleware-to-modify-response-body. I may have mistakenly linked to an issue that wasn't exactly the problem I had, but contained a comment which helped me fix the problem. Looking back, it's still unclear why the response stream just can't be replaced. I looked at the current implementation (https://github.com/aspnet/KestrelHttpServer/blob/rel/2.0.0/src/Microsoft.AspNetCore.Server.Kestrel.Core/Internal/Http/FrameResponseStream.cs) and future implementation (https://github.com/aspnet/KestrelHttpServer/blob/2.1.0-preview1-final/src/Kestrel.Core/Internal/Http/HttpResponseStream.cs) and I don't see anything that stands out as a showstopper. Is the current behavior Kestrel-related or something with the middleware infrastructure?


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>