https://github.com/sinatra/sinatra/blob/master/lib/sinatra/base.rb#L1831