<commit_before># coding: UTF-8

class ApplicationController < ActionController::Base
  include ::SslRequirement
  protect_from_forgery

  helper :all

  before_filter :browser_is_html5_compliant?
  before_filter :allow_cross_domain_access
  before_filter :set_asset_debugging
  after_filter  :remove_flash_cookie

  rescue_from NoHTML5Compliant, :with => :no_html5_compliant
  rescue_from RecordNotFound,   :with => :render_404

  # this disables SSL requirement in non-production environments
  unless Rails.env.production? || Rails.env.staging?
    def self.ssl_required(*splat)
      false
    end
    def self.ssl_allowed(*splat)
      true
    end
  end


  protected

  def set_asset_debugging
    #
    # IF YOU CHANGE AND COMMIT THIS YOU WILL GO DIRECTLY TO THE HELL WITH ALL THE RUBY PEOPLE
    CartoDB::Application.config.assets.debug = false if Rails.env.development?
    #
    #
  end

  def allow_cross_domain_access
    unless Rails.env.production? || Rails.env.staging?
      response.headers["Access-Control-Allow-Origin"] = "*"
      response.headers["Access-Control-Allow-Methods"] = "*"
    end
  end

  def render_403<commit_msg>Enables asset debugging (sorry sorry sorry)<commit_after># coding: UTF-8

class ApplicationController < ActionController::Base
  include ::SslRequirement
  protect_from_forgery

  helper :all

  before_filter :browser_is_html5_compliant?
  before_filter :allow_cross_domain_access
  before_filter :set_asset_debugging
  after_filter  :remove_flash_cookie

  rescue_from NoHTML5Compliant, :with => :no_html5_compliant
  rescue_from RecordNotFound,   :with => :render_404

  # this disables SSL requirement in non-production environments
  unless Rails.env.production? || Rails.env.staging?
    def self.ssl_required(*splat)
      false
    end
    def self.ssl_allowed(*splat)
      true
    end
  end


  protected

  def set_asset_debugging
    #
    # IF YOU CHANGE AND COMMIT THIS YOU WILL GO DIRECTLY TO THE HELL WITH ALL THE RUBY PEOPLE
    CartoDB::Application.config.assets.debug = true if Rails.env.development?
    #
    #
  end

  def allow_cross_domain_access
    unless Rails.env.production? || Rails.env.staging?
      response.headers["Access-Control-Allow-Origin"] = "*"
      response.headers["Access-Control-Allow-Methods"] = "*"
    end
  end

  def render_403
{'fraction_non_alphanumeric': 0.0782122905027933, 'fraction_numerical': 0.008594757198109154, 'mean_word_length': 3.809917355371901, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '4140143', 'n_tokens_mistral': 769, 'n_tokens_neox': 712, 'n_words': 170}