Class Rainbows::MaxBody
In: lib/rainbows/max_body.rb
lib/rainbows/max_body.rb
Parent: Object

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 config.ru like this:

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

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.

Methods

call   call   limit_input!   limit_input!   new   new  

Public Class methods

This is automatically called when used with Rack::Builder#use

This is automatically called when used with Rack::Builder#use

Public Instance methods

our main Rack middleware endpoint

our main Rack middleware endpoint

[Validate]