module ActionDispatch::Http::MimeNegotiation

def accepts

Returns the accepted MIME type for the request.
def accepts
  @env["action_dispatch.request.accepts"] ||= begin
    header = @env['HTTP_ACCEPT'].to_s.strip
    if header.empty?
      [content_mime_type]
    else
      Mime::Type.parse(header)
    end
  end
end