-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Core] Don't throw from
Response.Content
if memory stream is private
Relax our constraint that the underlying buffer of the MemoryStream backing a buffered response be publicly visible. There are cases today where `RequestBodyPolicy` will not allocate a new MemoryStream. One example is if the response stream is already seekable (as is the case in our PlaybackTransport) nd we've observed that there are likely cases where `HttpClient` itself may use a MemoryStream as the response stream without allowing the underling buffer to be exposed. In cases where we can not extract the underlying body, just make a copy of it. Since we know the underlying stream is a memory stream, we don't need to worry about hidden IO. Fixes #21048
- Loading branch information
Showing
3 changed files
with
11 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters