<commit_before>module Api::V3
  class ApiController < ApplicationController

    before_action :authorize_account, except: [:new_user, :cors_check]
    before_action :save_request_data, :allow_origin_header
    before_action :find_model, except: [:new_user, :cors_check]
    before_action :find_item, only: [:update, :show, :destroy, :digest]
    before_action :authorize_action, except: [:new_user, :cors_check]

    rescue_from Exception, :with => :exception_handler

    respond_to :json

    def cors_check
      cors_headers
      render nothing: true
    end

    def allow_origin_header
      headers['Access-Control-Allow-Origin'] = request.headers['Origin'] || ::Cenit.homepage
    end

    def cors_headers
      allow_origin_header
      headers['Access-Control-Allow-Credentials'] = false<commit_msg>Bringing to front allow_origin_header callback<commit_after>module Api::V3
  class ApiController < ApplicationController

    before_action :allow_origin_header
    before_action :authorize_account, except: [:new_user, :cors_check]
    before_action :save_request_data
    before_action :find_model, except: [:new_user, :cors_check]
    before_action :find_item, only: [:update, :show, :destroy, :digest]
    before_action :authorize_action, except: [:new_user, :cors_check]

    rescue_from Exception, :with => :exception_handler

    respond_to :json

    def cors_check
      cors_headers
      render nothing: true
    end

    def allow_origin_header
      headers['Access-Control-Allow-Origin'] = request.headers['Origin'] || ::Cenit.homepage
    end

    def cors_headers
      allow_origin_header
      headers['Access-Control-Allow-Credentials'] = false
{'fraction_non_alphanumeric': 0.09259259259259259, 'fraction_numerical': 0.0011947431302270011, 'mean_word_length': 4.334394904458598, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1445201', 'n_tokens_mistral': 523, 'n_tokens_neox': 515, 'n_words': 112}