'Web-api request buffering issue when enabling MiniProfiler
I've been testing the Miniprofiler designed by the team at Stackoverflow on a web api I'm working with. On the same web api we have enabled buffering of requests to be able to re-read the body and log it.
When running the tests for the buffering of the requests I noticed the tests was flaky and would randomly fail when the MiniProfiler was enabled. After digging through the code I found that this enabling of buffering wraps the request body in a FileBufferingReadStream which is for some reason not happening randomly when the MiniProfiler is enabled or is being overridden.
I downloaded the repo of MiniProfiler and attempted to comment out the usage of AddMemoryCache and used Mongo DB as the storage rather than MemoryCache, but the issue would not go away unless I disable the MiniProfiler.
Has anyone come across this problem before or have a solution?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
