<commit_before>class UploadedFilesController < ApplicationController
  def file_upload
    uploaded_file = UploadedFile.new(file: params[:files][0])
    if uploaded_file.save
      render json: {
        files: [
          {
            "name" => uploaded_file.read_attribute(:file_file_name),
            "size" => uploaded_file.read_attribute(:file_file_size),
            "url" => uploaded_file.file.url,
            "id" => uploaded_file.id
          }
        ]
      }
    else
      render json: {
        error: {
          "message" => "An error prevents the uploaded file to be saved"
        }
      }
    end
  end
end
<commit_msg>Fix IE<commit_after>class UploadedFilesController < ApplicationController
  def file_upload
    # FIX IE
    if request.headers["HTTP_ACCEPT"].split(",").map(&:strip).include?("application/json")
      content_type = "application/json"
    else
      content_type = "text/plain"
    end

    uploaded_file = UploadedFile.new(file: params[:files][0])
    if uploaded_file.save
      render json: {
        files: [
          {
            "name" => uploaded_file.read_attribute(:file_file_name),
            "size" => uploaded_file.read_attribute(:file_file_size),
            "url" => uploaded_file.file.url,
            "id" => uploaded_file.id
          }
        ]
      }, content_type: content_type
    else
      render json: {
        error: {
          "message" => "An error prevents the uploaded file to be saved"
        }
      }, content_type: content_type
    end
  end
end

{'fraction_non_alphanumeric': 0.10842586544741999, 'fraction_numerical': 0.0013063357282821686, 'mean_word_length': 2.1457905544147846, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3007412', 'n_tokens_mistral': 463, 'n_tokens_neox': 450, 'n_words': 91}