POST request size limit

Hello,
I’m building a web application using Oxygen (which is using HTTP.jl). Is there a way to limit the max request size for HTTP post requests?

When I’m able to check the size in the request handler, the memory is already allocated. So that is already to late. A potential attacker or careless user would just send a request with two times the size of server memory and the server will go down resp. the process be killed by the kernel.

What is the solution for this issue? I would like to set a max request size, dependent on server memory, in HTTP.jl or Oxygen, is that possible?

Thank you!

BR Stefan

In case someone finds this in future the potential solution is posted here: Reject requests in HTTP.jl server based on memory usage - #5 by quinnj

or use a reverse proxy, like nginx.

1 Like