mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
13 lines
308 B
Ruby
13 lines
308 B
Ruby
|
module TestApps
|
||
|
|
||
|
# call with "GET /sleep<d> HTTP/1.1\r\n\r\n", where is the number of
|
||
|
# seconds to sleep
|
||
|
# same as rackup/sleep.ru
|
||
|
SLEEP = -> (env) do
|
||
|
dly = (env['REQUEST_PATH'][/\/sleep(\d+)/,1] || '0').to_i
|
||
|
sleep dly
|
||
|
[200, {"Content-Type" => "text/plain"}, ["Slept #{dly}"]]
|
||
|
end
|
||
|
|
||
|
end
|