summary refs log tree commit homepage
path: root/t/worker-follows-master-to-death.ru
blob: b372afd552300c26051ec51479de029f8e720bbc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
use Rack::ContentLength
headers = { 'Content-Type' => 'text/plain' }
run lambda { |env|
  /\A100-continue\z/i =~ env['HTTP_EXPECT'] and return [ 100, {}, [] ]
  env['rack.input'].read

  case env["PATH_INFO"]
  when %r{/sleep/(\d+)}
    Rainbows.sleep($1.to_i)
  end
  [ 200, headers, [ "#$$\n" ] ]
}