<commit_before># Base controller for OFN's API
require_dependency 'spree/api/controller_setup'
require "spree/core/controller_helpers/ssl"

module Api
  class BaseController < ActionController::Base
    include Spree::Api::ControllerSetup
    include Spree::Core::ControllerHelpers::SSL
    include ::ActionController::Head

    respond_to :json

    attr_accessor :current_api_user

    before_action :set_content_type
    before_action :authenticate_user
    after_action  :set_jsonp_format

    rescue_from Exception, with: :error_during_processing<commit_msg>Use ActionController::Metal and include StrongParameters<commit_after># Base controller for OFN's API
require_dependency 'spree/api/controller_setup'
require "spree/core/controller_helpers/ssl"

module Api
  class BaseController < ActionController::Metal
    include ActionController::StrongParameters
    include Spree::Api::ControllerSetup
    include Spree::Core::ControllerHelpers::SSL
    include ::ActionController::Head

    respond_to :json

    attr_accessor :current_api_user

    before_action :set_content_type
    before_action :authenticate_user
    after_action  :set_jsonp_format

    rescue_from Exception, with: :error_during_processing
{'fraction_non_alphanumeric': 0.06737880032867707, 'fraction_numerical': 0.0, 'mean_word_length': 5.804469273743017, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '7376019', 'n_tokens_mistral': 348, 'n_tokens_neox': 338, 'n_words': 75}