RequestSizeLimitAttribute: HTTP 500 instead of 413 in ASP.NET Core 2.1.401
问题 I have [RequestSizeLimit] on my API controller, and it kinda works as expected: requests bigger than specified limit are rejected. [HttpPut] [RequestSizeLimit(120_000_000)] public async Task<IActionResult> Put(IFormCollection form) { ... } The problem is, an exception is thrown: Microsoft.AspNetCore.Server.Kestrel.Core.BadHttpRequestException: Request body too large. at Microsoft.AspNetCore.Server.Kestrel.Core.BadHttpRequestException.Throw(RequestRejectionReason reason) at Microsoft