Closed jammi closed 11 years ago
Puma requires the client provide a valid Content-Length header in order to provide a body. In that case, there is no ability to stream an unknown number of bytes into puma. For very large files, there could be an option to limit the body size. Most people would do that via nginx and such.
A common issue is dealing with huge uploads and other long-running requests, like demonstrated by slowloris DOS attacks. In some cases, the DOS attack could be someone posting /dev/urandom to a http server, slowly filling its memory. In the slowloris case, the attack is just a really slow client. IMO, there should be an api for dealing with these cases separately, so before the user's code is called, there should be some kind of an hook that a request has been initiated, but not not complete yet, maybe another to signal that the headers are received and additionally something to inspect the status of the request body transmission. Could be very useful for regular cases of large file uploads, receiving audio/video streams and such.