Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,13 @@ private static async Task<WebSocket> Upgrade(HttpContext context)

// Upgrade the connection
Stream opaqueTransport = await upgradeFeature.UpgradeAsync();
Assert.Null(context.Features.Get<IHttpMaxRequestBodySizeFeature>().MaxRequestBodySize);

// In-process reads upgraded data through the same loop that enforces MaxRequestBodySize, so it
// must clear the limit. Out-of-process runs on Kestrel, which never enforces it once upgraded.
if (context.Features.Get<IServerVariablesFeature>() is not null)
{
Assert.Null(context.Features.Get<IHttpMaxRequestBodySizeFeature>().MaxRequestBodySize);
}

// Get the WebSocket object
var ws = WebSocket.CreateFromStream(opaqueTransport, isServer: true, subProtocol: null, keepAliveInterval: TimeSpan.FromMinutes(2));
Expand Down
Loading