1 # -*- encoding: binary -*-
4 # This middleware is used to ensure input is buffered to memory
5 # or disk (depending on size) before the application is dispatched
6 # by entirely consuming it (from TeeInput) beforehand.
8 # Usage (in config.ru):
10 # require 'unicorn/preread_input'
11 # if defined?(Unicorn)
12 # use Unicorn::PrereadInput
24 input = env["rack.input"]
25 if input.respond_to?(:rewind)
26 true while input.read(16384, buf)