require 'sinatra' require 'sinatra/contrib' set :logging, false get '/' do < 404 EOHTML end get '/sleep' do sleep 2 <Stuff EOHTML end get '/something' do 'Stuff' end get '/path_params' do <path_params path_params path_params path_params EOHTML end get '/foreign_domain' do <goto_foreign_domain EOHTML end get '/goto_foreign_domain' do redirect 'http://google.com/' end get '/relative_redirect' do headers 'Location' => '/stacked_redirect' 301 end get '/redirect' do redirect '/' end get '/skip_redirect' do redirect 'http://google.com' end get '/stacked_redirect' do redirect '/stacked_redirect1' end get '/stacked_redirect1' do redirect '/stacked_redirect2' end get '/stacked_redirect2' do redirect '/stacked_redirect3' end get '/stacked_redirect3' do redirect '/stacked_redirect4' end get '/stacked_redirect4' do end get '/redundant' do <Redundant 1 EOHTML end get '/redundant/1' do <Redundant 2 EOHTML end get '/redundant/2' do <Redundant 3 EOHTML end get '/redundant/3' do 'End of the line.' end get '/a_pushed_path' do end get '/some-path blah! %25&$' do < Weird EOHTML end get '/another weird path %25"&*[$)' do 'test' end get '/loop' do < Loop EOHTML end get '/loop_back' do < Loop EOHTML end get '/with_cookies' do cookies['my_cookie'] = 'my value' < This needs a cookie EOHTML end get '/with_cookies2' do if cookies['my_cookie'] == 'my value' <<-EOHTML This needs a cookie EOHTML end end get '/with_cookies3' do end get '/auto-redundant' do str = '' 10.times do str += <<-EOHTML Stuff EOHTML end 10.times do str += <<-EOHTML Stuff EOHTML end str end