Issue with buffering requests when MiniProfiler is enabled

I’ve been testing out the MiniProfiler in a web api and have come across an issue when enabling buffering of requests. The buffering is enabled to be able to re-read the body of requests for logging purposes. Under the hood I can see that the original request body stream is wrapped in a FileBufferingReadStream. The issue appeared when I was running tests which were enabling the logging and having the MiniProfiler enabled. What happened was that the original body stream was for some reason not wrapped in a FileBufferingReadStream and could not be re-read. The issue went away when I disabled the MiniProfiler. I’ve tried to download the MiniProfiler repo and comment out the usage of AddMemoryCache and not using MemoryCacheStorage and configure it to use MongoDb, but still the issue was there.
Has anyone come across this issue and how did you solve it?