Merge in 'release/5.0' changes

This commit is contained in:
dotnet-bot 2021-06-01 21:58:42 +00:00
commit e156e2de1c
3 changed files with 10 additions and 6 deletions

View File

@ -5,6 +5,7 @@
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework> <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
<GenerateDocumentationFile>false</GenerateDocumentationFile> <GenerateDocumentationFile>false</GenerateDocumentationFile>
<PackageTags>aspnetcore;identity;membership</PackageTags> <PackageTags>aspnetcore;identity;membership</PackageTags>
<IsPackable>true</IsPackable>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
@ -12,7 +13,6 @@
<Reference Include="Microsoft.Extensions.Configuration" /> <Reference Include="Microsoft.Extensions.Configuration" />
<Reference Include="Microsoft.Extensions.DependencyInjection" /> <Reference Include="Microsoft.Extensions.DependencyInjection" />
<Reference Include="Microsoft.Extensions.Logging" /> <Reference Include="Microsoft.Extensions.Logging" />
<Reference Include="Microsoft.AspNetCore.Testing" />
<Reference Include="xunit.assert" /> <Reference Include="xunit.assert" />
<Reference Include="xunit.extensibility.core" /> <Reference Include="xunit.extensibility.core" />
<Reference Include="xunit.analyzers" PrivateAssets="All" /> <Reference Include="xunit.analyzers" PrivateAssets="All" />

View File

@ -718,8 +718,13 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2
// Second reset // Second reset
if (stream.RstStreamReceived) if (stream.RstStreamReceived)
{ {
// Hard abort, do not allow any more frames on this stream. // https://tools.ietf.org/html/rfc7540#section-5.1
throw new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorStreamAborted(_incomingFrame.Type, stream.StreamId), Http2ErrorCode.STREAM_CLOSED); // 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. // No additional inbound header or data frames are allowed for this stream after receiving a reset.

View File

@ -3048,7 +3048,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests
} }
[Fact] [Fact]
public async Task RST_STREAM_IncompleteRequest_AdditionalResetFrame_ConnectionAborted() public async Task RST_STREAM_IncompleteRequest_AdditionalResetFrame_IgnoreAdditionalReset()
{ {
var tcs = new TaskCompletionSource<int>(TaskCreationOptions.RunContinuationsAsynchronously); var tcs = new TaskCompletionSource<int>(TaskCreationOptions.RunContinuationsAsynchronously);
@ -3066,8 +3066,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests
await SendRstStreamAsync(1); await SendRstStreamAsync(1);
tcs.TrySetResult(0); tcs.TrySetResult(0);
await WaitForConnectionErrorAsync<Http2ConnectionErrorException>(ignoreNonGoAwayFrames: false, expectedLastStreamId: 1, await StopConnectionAsync(expectedLastStreamId: 1, ignoreNonGoAwayFrames: false);
Http2ErrorCode.STREAM_CLOSED, CoreStrings.FormatHttp2ErrorStreamAborted(Http2FrameType.RST_STREAM, 1));
} }
[Fact] [Fact]