Add -N or --no-default-middleware option.
[zbatery.git] / t / large-file-response.ru
blob84163c1022ae6a0c7b60217dd2f4b5222cf2f960
1 # lib-large-file-response will stop running if we're not on Linux here
2 use Rack::ContentLength
3 use Rack::ContentType
4 map "/rss" do
5   run lambda { |env|
6     # on Linux, this is in kilobytes
7     GC.start if GC.respond_to?(:start)
8     ::File.read("/proc/self/status") =~ /^VmRSS:\s+(\d+)/
9     [ 200, {}, [ ($1.to_i * 1024).to_s ] ]
10   }
11 end
12 map "/" do
13   run Rack::File.new(Dir.pwd)
14 end