1 # -*- encoding: binary -*-
2 module Metropolis::Common
3 include Rack::Utils # unescape
5 def r(code, body = nil)
6 body ||= "#{HTTP_STATUS_CODES[code]}\n"
8 { 'Content-Length' => body.size.to_s, 'Content-Type' => 'text/plain' },
13 if %r{\A/(.*)\z} =~ env["PATH_INFO"]
15 case env["REQUEST_METHOD"]