For security, I would like to set the maximum request length in my node.js application. (There are many security vulnerabilities that web servers use that allow unlimited request lengths).
Is it possible? Is there another one?
I assume that you mean data that the client can send to you through POST. If you use Express, you can use limit middleware to achieve this: http://senchalabs.github.com/connect/middleware-limit.html
A short version of what has been done there:
req.on('data', function(chunk){ received += chunk.length; if (received > bytes) req.destroy(); });
Source: https://habr.com/ru/post/904857/More articles:What is the difference between these three ways to create a new in C #? - c #How can I pass an NSNumber to a method waiting for a bool? - objectShould Join tables be created as indexed tables (clustered indexes)? - oracleCheck strings for identical characters in Objective-C - objective-cSwipe to delete in UITableViewCell on a white background, you need to clear - iosWordpress: excluding images inserted into message 'from get_children - attachmentClojure documentation in Emacs - emacsLoss of data using a list of functions - rParental control Scrolling ScrollViewer instead of ScrollViewer child control - c #JAVADOC for private methods (BlueJ) - javaAll Articles