Is there a way to refuse a request with a body (content-length header probably) larger than a predefined amount?
Asked
Active
Viewed 35 times
0
-
If you are using IIS you can set maxAllowedContentLength. – Calidus Oct 29 '19 at 19:16
-
nope, not using IIS... – Leonardo Oct 29 '19 at 19:18
-
[this](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.requestsizelimitattribute?view=aspnetcore-3.0) could help? – Alex S. Diaz Oct 29 '19 at 20:00
-
"refuse a request" -- do you mean "refuse" like a firewall dropping the connection, or do you mean "refuse" like send back a 500 status code or similar – BurnsBA Oct 29 '19 at 20:30
-
Check [this](https://stackoverflow.com/a/58566617/5751404) for different host service . – Nan Yu Oct 30 '19 at 03:08
-
Are you using nginx? – Calidus Oct 31 '19 at 13:01