aspnet/HttpAbstractions

Make `BufferingHelper` public

dougbu opened this issue · 2 comments

This class is currently pub-internal. An implementation is necessary when reading the request body multiple times. For example, ASP.NET Core WebHooks includes resource filters that calculate hashes of body content. They use the following helper to ensure this is safe:
https://github.com/aspnet/WebHooks/blob/be8571953a0124c0877f777e8fb5bb17329204ab/src/Microsoft.AspNetCore.WebHooks.Receivers/Filters/WebHookVerifyBodyContentFilter.cs#L94-L106

For reference: https://github.com/aspnet/HttpAbstractions/blob/3e3772eecd4cc57399c28a3f899e6b0406ef2e1b/src/Microsoft.AspNetCore.Http/Internal/BufferingHelper.cs

Hmm, MVC used this class in a few places long before the ASP.NET Core WebHooks implementation was a thing.

This issue was moved to dotnet/aspnetcore#2684