This repository was archived by the owner on Dec 14, 2018. It is now read-only.
This repository was archived by the owner on Dec 14, 2018. It is now read-only.
Implement an attribute and filter to configure the request body size limit #6352
Closed
Description
E.g. [RequestSizeLimit(Bytes=12345)]
(nullable long)
This would use a Feature implemented by the servers to adjust the request size limit per request. See aspnet/KestrelHttpServer#1877.
This filter needs to be high priority so it runs before model binding or anything else that might read from the request body.
Scenario: The app has a low default limit that's acceptable for most endpoints (e.g. 1mb), but for some upload or streaming endpoints it needs a much higher or infinite limit.
Open question: What to do if the Feature can't be resolved? Throw NotSupportedException? Kestrel and HttpSysServer should support this by 2.0.