Skip to content

Correct ValidateStreamForReading(...) #390

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 24, 2023

Conversation

dougbu
Copy link
Member

@dougbu dougbu commented Feb 23, 2023

@dougbu dougbu enabled auto-merge (squash) February 23, 2023 23:54
dougbu and others added 3 commits February 23, 2023 16:31
- fix aspnet#389
- check `Stream` before first read attempt
- check `CanRead` (not `CanSeek`) before second or later read attempts
- add lots of tests of related scenarios
- nit: correct a recent `HttpContentMessageExtensions` comment
Co-authored-by: Chris Ross <Tratcher@Outlook.com>
- `ReadAsStreamAsync()` introduces unwanted behaviours
  - returned `Stream` cannot be read multiple times and is not recreated on next `ReadAsStreamAsync` call
  - method buffers the `HttpContent`, invalidating the intent of `unBuffered`
@dougbu dougbu force-pushed the dougbu/canread.vs.canseek branch from 2013be5 to 0d58c82 Compare February 24, 2023 01:19
@dougbu dougbu disabled auto-merge February 24, 2023 01:19
@dougbu dougbu enabled auto-merge (squash) February 24, 2023 01:20
@dougbu
Copy link
Member Author

dougbu commented Feb 24, 2023

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@dougbu dougbu merged commit eae75d6 into aspnet:main Feb 24, 2023
@dougbu dougbu deleted the dougbu/canread.vs.canseek branch February 24, 2023 04:06
@dougbu dougbu added this to the 3.3.0 (5.3.0) milestone Feb 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MessageHttpContext does not handle unreadable/unseekable Streams well
2 participants