unicorn.git  about / heads / tags
Rack HTTP server for Unix and fast clients
blob fab5fce1d6d8123882788357d985c6b25ee1174c 348 bytes (raw)
$ git show v4.5.0:t/t0116.ru	# shows this blob on the CLI

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
 
#\ -E none
use Rack::ContentLength
use Rack::ContentType, 'text/plain'
app = lambda do |env|
  input = env['rack.input']
  case env["PATH_INFO"]
  when "/tmp_class"
    body = input.instance_variable_get(:@tmp).class.name
  when "/input_class"
    body = input.class.name
  else
    return [ 500, {}, [] ]
  end
  [ 200, {}, [ body ] ]
end
run app

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