Doing something different depending on file extension (MIME type) in Sinatra

This looks like a solution: sinatra-respond_to