Closed 64J0 closed 2 months ago
I'm not sure how to test this properly. Ideas are welcome!
The original bug report was that the body gets disposed.
I would think that asserting the presence of the body post-use
would be a good test.
@64J0 Here is a similar type of scenario I had to add over in FsToolkit.ErrorHandling to deal with dispose issues https://github.com/demystifyfp/FsToolkit.ErrorHandling/pull/271 if you were still looking for some unit test ideas
Thanks for the ideas folks! I'll work on it during this week
Description
As noticed by @xperiandri, the
ReadBodyFromRequestAsync
seems to be incorrectly disposing thectx.Request.Body
. I'm adopting the suggestion from @Banashek, to use theleaveOpen = true
parameter.From the docs:
How to test
Check the automated tests.
*Thanks @Banashek and @1eyewonder for the comments and ideas.
Related issues