Ignore MaxRequestBodySize for upgraded requests (#13477)

This commit is contained in:
Brennan 2019-08-27 13:53:09 -07:00 committed by GitHub
parent 3e253f6a40
commit ecae6838b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View File

@ -312,6 +312,7 @@ namespace Microsoft.AspNetCore.Server.IIS.Core
throw new InvalidOperationException(CoreStrings.UpgradeCannotBeCalledMultipleTimes);
}
MaxRequestBodySize = null;
_wasUpgraded = true;
StatusCode = StatusCodes.Status101SwitchingProtocols;

View File

@ -98,6 +98,7 @@ namespace TestSite
// Upgrade the connection
Stream opaqueTransport = await upgradeFeature.UpgradeAsync();
Assert.Null(context.Features.Get<IHttpMaxRequestBodySizeFeature>().MaxRequestBodySize);
// Get the WebSocket object
var ws = WebSocket.CreateFromStream(opaqueTransport, isServer: true, subProtocol: null, keepAliveInterval: TimeSpan.FromMinutes(2));