Open akatakritos opened 1 year ago
Thanks for posting this issue! It looks like you're correct -- the Httprequest message/streamcontent/cryptostream all in turn dispose of the underlying. We'll add this into our next batch of infer backend model updates.
Found this in a real project. We're uploading files to a rather interesting HTTP API that expects its content to be base64 encoded. Rather than loading large files into memory and running
Convert.ToBase64String
I found some guidance on how to useCryptoStream
to create a stream that base64 encodes on the fly.Ran with docker:
Output
Reading through all the framework code, I think that when
HttpRequestMessage
is disposed, it will dispose theStreamContent
which will dispose theCryptoStream
which will dispose theFileStream
.