unicorn.git  about / heads / tags
Rack HTTP server for Unix and fast clients
blob ccc6a8e93d42c9c8d6a28bc260c872ae08b3e711 350 bytes (raw)
$ git show HEAD:t/heartbeat-timeout.ru	# shows this blob on the CLI

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
 
# frozen_string_literal: false
use Rack::ContentLength
headers = { 'content-type' => 'text/plain' }
run lambda { |env|
  case env['PATH_INFO']
  when "/block-forever"
    Process.kill(:STOP, $$)
    sleep # in case STOP signal is not received in time
    [ 500, headers, [ "Should never get here\n" ] ]
  else
    [ 200, headers, [ "#$$" ] ]
  end
}

git clone https://yhbt.net/unicorn.git