I have a program in Node.JS, using Express. When I do a POST request to this program, what is the maximum accepted size for the data in the request? Is there any way to set this size?
If you are using Express, you can use the limit middleware: http://senchalabs.github.com/connect/middleware-limit.html
If you are interested in it's implementation, it does something like this:
// limit
req.on('data', function(chunk){
received += chunk.length;
if (received > bytes) deny();
});
For more details check the code on github: https://github.com/senchalabs/connect/blob/master/lib/middleware/limit.js
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With