xref: /unit/test/ruby/variables/config.ru (revision 585:17703effc76a)
1app = Proc.new do |env|
2    body = env['rack.input'].read
3    version = env['rack.version'].join('')
4
5    ['200', {
6        'Content-Type' => env['CONTENT_TYPE'],
7        'Content-Length' => body.length.to_s,
8        'Request-Method' => env['REQUEST_METHOD'],
9        'Request-Uri' => env['REQUEST_URI'],
10        'Http-Host' => env['HTTP_HOST'],
11        'Server-Protocol' => env['SERVER_PROTOCOL'],
12        'Custom-Header' => env['HTTP_CUSTOM_HEADER'],
13        'Rack-Version' => version,
14        'Rack-Url-Scheme' => env['rack.url_scheme'],
15        'Rack-Multithread' => env['rack.multithread'].to_s,
16        'Rack-Multiprocess' => env['rack.multiprocess'].to_s,
17        'Rack-Run-Once' => env['rack.run_once'].to_s,
18        'Rack-Hijack-Q' => env['rack.hijack?'].to_s,
19        'Rack-Hijack' => env['rack.hijack'].to_s,
20        'Rack-Hijack-IO' => env['rack.hijack_io'].to_s
21    }, [body]]
22end
23
24run app
25