diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Stream.cs b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Stream.cs index 6fc6b3ea827eb..02595b3488597 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Stream.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Stream.cs @@ -1072,12 +1072,11 @@ private async ValueTask SendDataAsync(ReadOnlyMemory buffer, CancellationT { Debug.Assert(_requestBodyCancellationSource != null); - // Deal with [ActiveIssue("https://github.com/dotnet/runtime/issues/17492")] - // Custom HttpContent classes do not get passed the cancellationToken. - // So, inject the expected CancellationToken here, to ensure we can cancel the request body send if needed. + // Cancel the request body sending if cancellation is requested on the supplied cancellation token. CancellationTokenRegistration linkedRegistration = cancellationToken.CanBeCanceled && cancellationToken != _requestBodyCancellationSource.Token ? RegisterRequestBodyCancellation(cancellationToken) : default; + try { while (buffer.Length > 0)