Skip to content

Commit ecae683

Browse files
Ignore MaxRequestBodySize for upgraded requests (#13477)
1 parent 3e253f6 commit ecae683

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/Servers/IIS/IIS/src/Core/IISHttpContext.FeatureCollection.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ async Task<Stream> IHttpUpgradeFeature.UpgradeAsync()
312312
throw new InvalidOperationException(CoreStrings.UpgradeCannotBeCalledMultipleTimes);
313313
}
314314

315+
MaxRequestBodySize = null;
315316
_wasUpgraded = true;
316317

317318
StatusCode = StatusCodes.Status101SwitchingProtocols;

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.WebSockets.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ private static async Task<WebSocket> Upgrade(HttpContext context)
9898

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

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

0 commit comments

Comments
 (0)