ring
ring copied to clipboard
How to limit max upload size?
Is there any way to limit max upload size? If so could you provide an example please?
You mean with the multipart middleware?
On jetty side, I have an endpoint which accepts octet-stream I want it to fail if it exceeds the limit.
Also yes, multipart middleware
@weavejester any suggestions?
You can create a custom multipart store that limits the files to a certain size. Take a look at ring.middleware.multipart-params.temp-file and ring.middleware.multipart-params.byte-array. You can adapt or wrap these multipart stores to limit the size of the items.
I don't currently have time to come up with an example for you, however.
@weavejester thank you so much I think I figured it out! Are you gonna add this functionality to ring any time soon? That would be useful though
When I get time, or someone sends me a PR, it would be useful functionality to have.