-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Kestrel settings are not applied if configure KestrelServerOptions in appsettings.json file #37544
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
MultipartBodyLengthLimit is a different limit than you've set in config. Which exception do you get during a request? |
if the upload file size exceeds the limitation it throws BadHttpRequestException. |
This is a known limitation of Kestrel's config integration, it only supports Endpoints, not other options. To read options you need to add this:
|
Duplicate of #4765 |
Hi @Tratcher, |
Then where do you see the BadHttpRequestException? |
Model binding has an opportunity to catch and handle request body exceptions. A connection reset is expected when the request body size limits are exceeded, disconnecting the client is the only mitigation for a potential DOS attack. |
I am unable to configure KestrelServerOptions in appsettings.json file.
I tested the below settings, it doesn't work. it still takes default value (30,000,000 bytes => 28.6MB).
-- MaxRequestBodySize
-- MaxRequestHeaderCount
if I do it in C# code, it works.
Further technical details
dotnet --info
:dotnet --info Output
The text was updated successfully, but these errors were encountered: