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:
:Coolio
:CoolioThreadPool
:CoolioThreadSpawn
:Epoll
:EventMachine
:NeverBlock
:Rev
:RevThreadPool
:RevThreadSpawn
:XEpoll
However, the global Rainbows::Configurator#client_max_body_size
is compatible with all concurrency models Rainbows! supports.
new (app, limit = nil) source
This is automatically called when used with Rack::Builder#use
call (env) source
our main Rack middleware endpoint
limit_input! (env) source
mail archives: https://yhbt.net/rainbows-public/ http://ou63pmih66umazou.onion/rainbows-public/ nntp://news.public-inbox.org/inbox.comp.lang.ruby.rainbows nntp://ou63pmih66umazou.onion/inbox.comp.lang.ruby.rainbows nntp://news.gmane.io/gmane.comp.lang.ruby.rainbows.general public: rainbows-public@yhbt.net source code: git clone https://yhbt.net/rainbows.git torsocks git clone http://ou63pmih66umazou.onion/rainbows.git