class Sinatra::Request

def accept

Returns an array of acceptable media types for the response
def accept
  @env['HTTP_ACCEPT'].to_s.split(',').map { |a| a.strip }
end