diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Connection.cs b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Connection.cs index 11d4d9ce5bb9a..ce524c4841f76 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Connection.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Connection.cs @@ -1492,6 +1492,11 @@ private void AddStream(Http2Stream http2Stream) Shutdown(); } + if (_abortException is not null) + { + throw GetRequestAbortedException(_abortException); + } + if (_shutdown) { // The connection has shut down. Throw a retryable exception so that this request will be handled on another connection. diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.Http2.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.Http2.cs index 1aadb515353a2..c9c5db60d0f00 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.Http2.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.Http2.cs @@ -243,7 +243,6 @@ public async Task Http2_ServerSendsValidSettingsValues_Success() } } - [ActiveIssue("https://github.com/dotnet/runtime/issues/1581")] [ConditionalTheory(nameof(SupportsAlpn))] [InlineData(SettingId.MaxFrameSize, 16383)] [InlineData(SettingId.MaxFrameSize, 162777216)]