Redirecting to ...
Last Modified
2011-05-10 23:34:43 +0000
  • rainbows/max_body/wrapper
  • rainbows/max_body/rewindable_wrapper
Trac URL


Middleware used to enforce client_max_body_size for TeeInput users.

There is no need to configure this middleware manually, it will automatically be configured for you based on the client_max_body_size setting.

For more fine-grained control, you may also define it per-endpoint in your Rack like this:

map "/limit_1M" do
  use Rainbows::MaxBody, 1024*1024
  run MyApp
map "/limit_10M" do
  use Rainbows::MaxBody, 1024*1024*10
  run MyApp

This is only compatible with concurrency models that expose a streaming “rack.input” to the Rack application. Thus it is NOT compatible with any of the following as they fully buffer the request body before the application dispatch:

However, the global Rainbows::Configurator#client_max_body_size is compatible with all concurrency models Rainbows! supports.