diff --git a/src/Microsoft.AspNetCore.Server.IISIntegration/IISMiddleware.cs b/src/Microsoft.AspNetCore.Server.IISIntegration/IISMiddleware.cs index 6d3e9ca79e..030682807c 100644 --- a/src/Microsoft.AspNetCore.Server.IISIntegration/IISMiddleware.cs +++ b/src/Microsoft.AspNetCore.Server.IISIntegration/IISMiddleware.cs @@ -74,7 +74,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration } var bodySizeFeature = httpContext.Features.Get(); - if (bodySizeFeature != null) + if (bodySizeFeature != null && !bodySizeFeature.IsReadOnly) { // IIS already limits this, no need to do it twice. bodySizeFeature.MaxRequestBodySize = null;