diff --git a/config.ru b/config.ru index a709f06..0c274dc 100755 --- a/config.ru +++ b/config.ru @@ -11,6 +11,19 @@ map '/lobster' do run Rack::Lobster.new end +map '/headers' do + headers = proc do |env| + [200, { "Content-Type" => "text/plain" }, [ + env.select {|key,val| key.start_with? 'HTTP_'} + .collect {|key, val| [key.sub(/^HTTP_/, ''), val]} + .collect {|key, val| "#{key}: #{val}"} + .sort + .join("\n") + ]] + end + run headers +end + map '/' do welcome = proc do |env| [200, { "Content-Type" => "text/html" }, [<