diff --git a/src/Identity/Specification.Tests/src/Microsoft.AspNetCore.Identity.Specification.Tests.csproj b/src/Identity/Specification.Tests/src/Microsoft.AspNetCore.Identity.Specification.Tests.csproj
index 141b4cd301..b1c9aa50f5 100644
--- a/src/Identity/Specification.Tests/src/Microsoft.AspNetCore.Identity.Specification.Tests.csproj
+++ b/src/Identity/Specification.Tests/src/Microsoft.AspNetCore.Identity.Specification.Tests.csproj
@@ -5,6 +5,7 @@
$(DefaultNetCoreTargetFramework)
false
aspnetcore;identity;membership
+ true
@@ -12,7 +13,6 @@
-
diff --git a/src/Servers/Kestrel/Core/src/Internal/Http2/Http2Connection.cs b/src/Servers/Kestrel/Core/src/Internal/Http2/Http2Connection.cs
index 86b13a09c4..10524d020b 100644
--- a/src/Servers/Kestrel/Core/src/Internal/Http2/Http2Connection.cs
+++ b/src/Servers/Kestrel/Core/src/Internal/Http2/Http2Connection.cs
@@ -718,8 +718,13 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2
// Second reset
if (stream.RstStreamReceived)
{
- // Hard abort, do not allow any more frames on this stream.
- throw new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorStreamAborted(_incomingFrame.Type, stream.StreamId), Http2ErrorCode.STREAM_CLOSED);
+ // https://tools.ietf.org/html/rfc7540#section-5.1
+ // If RST_STREAM has already been received then the stream is in a closed state.
+ // Additional frames (other than PRIORITY) are a stream error.
+ // The server will usually send a RST_STREAM for a stream error, but RST_STREAM
+ // shouldn't be sent in response to RST_STREAM to avoid a loop.
+ // The best course of action here is to do nothing.
+ return Task.CompletedTask;
}
// No additional inbound header or data frames are allowed for this stream after receiving a reset.
diff --git a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs
index 794fdf1946..ad210a33c9 100644
--- a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs
+++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs
@@ -3048,7 +3048,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests
}
[Fact]
- public async Task RST_STREAM_IncompleteRequest_AdditionalResetFrame_ConnectionAborted()
+ public async Task RST_STREAM_IncompleteRequest_AdditionalResetFrame_IgnoreAdditionalReset()
{
var tcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously);
@@ -3066,8 +3066,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests
await SendRstStreamAsync(1);
tcs.TrySetResult(0);
- await WaitForConnectionErrorAsync(ignoreNonGoAwayFrames: false, expectedLastStreamId: 1,
- Http2ErrorCode.STREAM_CLOSED, CoreStrings.FormatHttp2ErrorStreamAborted(Http2FrameType.RST_STREAM, 1));
+ await StopConnectionAsync(expectedLastStreamId: 1, ignoreNonGoAwayFrames: false);
}
[Fact]