11 implementations of MaxRequestBodySize
BasicWebSite (1)
StartupRequestLimitSize.cs (1)
131public long? MaxRequestBodySize { get; set; }
Microsoft.AspNetCore.Mvc.Core.Test (2)
Filters\DisableRequestSizeLimitFilterTest.cs (1)
131public long? MaxRequestBodySize
Filters\RequestSizeLimitFilterTest.cs (1)
137public long? MaxRequestBodySize
Microsoft.AspNetCore.Mvc.FunctionalTests (1)
AntiforgeryMiddlewareTest.cs (1)
263public long? MaxRequestBodySize { get; set; }
Microsoft.AspNetCore.RequestDecompression.Microbenchmarks (1)
RequestDecompressionMiddlewareBenchmark.cs (1)
68public long? MaxRequestBodySize { get; set; } = 30_000_000;
Microsoft.AspNetCore.RequestDecompression.Tests (1)
RequestDecompressionMiddlewareTests.cs (1)
787public long? MaxRequestBodySize { get; set; }
Microsoft.AspNetCore.Routing.FunctionalTests (1)
MinimalFormTests.cs (1)
789public long? MaxRequestBodySize { get; set; }
Microsoft.AspNetCore.Routing.Tests (1)
EndpointRoutingMiddlewareTest.cs (1)
445public long? MaxRequestBodySize { get; set; }
Microsoft.AspNetCore.Server.HttpSys (1)
RequestProcessing\RequestContext.FeatureCollection.cs (1)
587long? IHttpMaxRequestBodySizeFeature.MaxRequestBodySize
Microsoft.AspNetCore.Server.IIS (1)
Core\IISHttpContext.FeatureCollection.cs (1)
439long? IHttpMaxRequestBodySizeFeature.MaxRequestBodySize
Microsoft.AspNetCore.Server.Kestrel.Core (1)
Internal\Http\HttpProtocol.FeatureCollection.cs (1)
200long? IHttpMaxRequestBodySizeFeature.MaxRequestBodySize
24 writes to MaxRequestBodySize
Binding.Http.IntegrationTests (1)
MtomBindingTestHelper.cs (1)
54context.Features.Get<IHttpMaxRequestBodySizeFeature>().MaxRequestBodySize = 5_368_709_120;
IIS.Tests (4)
MaxRequestBodySizeTests.cs (4)
76feature.MaxRequestBodySize = perRequestMaxRequestBodySize; 112feature.MaxRequestBodySize = null; 139feature.MaxRequestBodySize = null; 252feature.MaxRequestBodySize = perRequestMaxRequestBodySize);
InMemory.FunctionalTests (9)
Http2\Http2StreamTests.cs (2)
2052context.Features.Get<IHttpMaxRequestBodySizeFeature>().MaxRequestBodySize = 17; 2112context.Features.Get<IHttpMaxRequestBodySizeFeature>().MaxRequestBodySize = 12;
Http3\Http3StreamTests.cs (2)
2665context.Features.Get<IHttpMaxRequestBodySizeFeature>().MaxRequestBodySize = 17; 2717context.Features.Get<IHttpMaxRequestBodySizeFeature>().MaxRequestBodySize = 12;
MaxRequestBodySizeTests.cs (5)
175feature.MaxRequestBodySize = perRequestMaxRequestBodySize; 217feature.MaxRequestBodySize = null; 298feature.MaxRequestBodySize = perRequestMaxRequestBodySize); 338feature.MaxRequestBodySize = 0x10); 524feature.MaxRequestBodySize = chunkedPayload.Length;
Kestrel.SampleApp (1)
Startup.cs (1)
37context.Features.Get<IHttpMaxRequestBodySizeFeature>().MaxRequestBodySize = 1024;
Microsoft.AspNetCore.Mvc.Core (2)
Filters\DisableRequestSizeLimitFilter.cs (1)
55maxRequestBodySizeFeature.MaxRequestBodySize = null;
Filters\RequestSizeLimitFilter.cs (1)
57maxRequestBodySizeFeature.MaxRequestBodySize = Bytes;
Microsoft.AspNetCore.Routing (1)
EndpointRoutingMiddleware.cs (1)
323maxRequestBodySizeFeature.MaxRequestBodySize = maxRequestBodySize;
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (3)
OpaqueUpgradeTests.cs (1)
146Assert.Throws<InvalidOperationException>(() => feature.MaxRequestBodySize = 12);
RequestBodyLimitTests.cs (2)
367feature.MaxRequestBodySize = 12; 391feature.MaxRequestBodySize = 12;
Microsoft.AspNetCore.Server.IISIntegration (1)
IISMiddleware.cs (1)
132bodySizeFeature.MaxRequestBodySize = null;
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (2)
Http1\Http1ConnectionTests.cs (2)
940var ex = Assert.Throws<InvalidOperationException>(() => ((IHttpMaxRequestBodySizeFeature)_http1Connection).MaxRequestBodySize = 1); 948var ex = Assert.Throws<ArgumentOutOfRangeException>(() => ((IHttpMaxRequestBodySizeFeature)_http1Connection).MaxRequestBodySize = -1);
30 references to MaxRequestBodySize
BasicWebSite (8)
StartupRequestLimitSize.cs (8)
76if (_maxRequestBodySizeFeature.MaxRequestBodySize != null 77&& _innerStream.CanSeek && _innerStream.Length > _maxRequestBodySizeFeature.MaxRequestBodySize) 85if (_maxRequestBodySizeFeature.MaxRequestBodySize != null 86&& _totalRead > _maxRequestBodySizeFeature.MaxRequestBodySize) 95if (_maxRequestBodySizeFeature.MaxRequestBodySize != null 96&& _innerStream.CanSeek && _innerStream.Length > _maxRequestBodySizeFeature.MaxRequestBodySize) 104if (_maxRequestBodySizeFeature.MaxRequestBodySize != null 105&& _totalRead > _maxRequestBodySizeFeature.MaxRequestBodySize)
IIS.Tests (3)
MaxRequestBodySizeTests.cs (3)
75Assert.Equal(maxRequestSize, feature.MaxRequestBodySize); 111Assert.Equal(0, feature.MaxRequestBodySize); 138Assert.Equal(0, feature.MaxRequestBodySize);
InMemory.FunctionalTests (5)
MaxRequestBodySizeTests.cs (5)
172Assert.Equal(globalMaxRequestBodySize, feature.MaxRequestBodySize); 214Assert.Equal(0, feature.MaxRequestBodySize); 294Assert.Equal(new KestrelServerLimits().MaxRequestBodySize, feature.MaxRequestBodySize); 334Assert.Equal(new KestrelServerLimits().MaxRequestBodySize, feature.MaxRequestBodySize); 516Assert.Equal(globalMaxRequestBodySize, feature.MaxRequestBodySize);
InProcessWebSite (2)
src\Servers\IIS\IIS\test\testassets\InProcessWebSite\Startup.cs (1)
1074public Task BodyLimit(HttpContext ctx) => ctx.Response.WriteAsync(ctx.Features.Get<IHttpMaxRequestBodySizeFeature>()?.MaxRequestBodySize?.ToString(CultureInfo.InvariantCulture) ?? "null");
src\Servers\IIS\IIS\test\testassets\InProcessWebSite\Startup.WebSockets.cs (1)
156Assert.Null(context.Features.Get<IHttpMaxRequestBodySizeFeature>().MaxRequestBodySize);
Microsoft.AspNetCore.Http.Features (1)
IHttpMaxRequestBodySizeFeature.cs (1)
12/// Indicates whether <see cref="MaxRequestBodySize"/> is read-only.
Microsoft.AspNetCore.Mvc.Core (4)
Filters\DisableRequestSizeLimitFilter.cs (2)
10/// A filter that sets <see cref="IHttpMaxRequestBodySizeFeature.MaxRequestBodySize"/> 26/// Sets the <see cref="IHttpMaxRequestBodySizeFeature.MaxRequestBodySize"/>
Filters\RequestSizeLimitFilter.cs (2)
11/// A filter that sets the <see cref="IHttpMaxRequestBodySizeFeature.MaxRequestBodySize"/> 29/// Sets the <see cref="IHttpMaxRequestBodySizeFeature.MaxRequestBodySize"/> to <see cref="Bytes"/>.
Microsoft.AspNetCore.Mvc.FunctionalTests (1)
AntiforgeryMiddlewareTest.cs (1)
111context.Request.Body = new SizeLimitedStream(context.Request.Body, context.Features.Get<IHttpMaxRequestBodySizeFeature>()?.MaxRequestBodySize);
Microsoft.AspNetCore.RequestDecompression (1)
RequestDecompressionMiddleware.cs (1)
63?? context.Features.Get<IHttpMaxRequestBodySizeFeature>()?.MaxRequestBodySize;
Microsoft.AspNetCore.Routing.FunctionalTests (1)
MinimalFormTests.cs (1)
451context.Request.Body = new SizeLimitedStream(context.Request.Body, context.Features.Get<IHttpMaxRequestBodySizeFeature>()?.MaxRequestBodySize);
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (4)
OpaqueUpgradeTests.cs (2)
137Assert.Null(feature.MaxRequestBodySize); // GET/Upgrade requests don't actually have an entity body, so they can't set the limit. 145Assert.Null(feature.MaxRequestBodySize);
RequestBodyLimitTests.cs (2)
366Assert.Equal(11, feature.MaxRequestBodySize); 390Assert.Equal(11, feature.MaxRequestBodySize);