[browser] [wasm] Remove manual ThrowIfCancellationRequested from ReadAsync response streaming #91834
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While working on #91699 I noticed that there was one manual call to
ThrowIfCancellationRequested
inReadAsync
when doing response streaming, which means that this cancellation token does not go through theCancelationHelper
which means that this won't abort the actual fetch request.It normally shouldn't be an issue because developers are supposed to dispose the
HttpResponseMessage
/Stream
which both would abort the fetch request.With this PR
ReadAsync
would also abort the fetch request:All other methods which could have called
ThrowIfCancellationRequested
also didn't and correctly go throughCancelationHelper
.runtime/src/libraries/System.Net.Http/src/System/Net/Http/BrowserHttpHandler/BrowserHttpHandler.cs
Line 455 in d859279
runtime/src/libraries/System.Net.Http/src/System/Net/Http/BrowserHttpHandler/BrowserHttpHandler.cs
Line 504 in d859279