<commit_before># Define an application-wide content security policy
# For further information see the following documentation
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy

if Rails.env.production?
  assets_host = Rails.configuration.action_controller.asset_host || "https://#{ENV['WEB_DOMAIN'] || ENV['LOCAL_DOMAIN']}"
  data_hosts = [assets_host]
  cloudflarecdn = 'https://cdnjs.cloudflare.com'
  mathjax = 'https://cdn.mathjax.org'

  if ENV['S3_ENABLED'] == 'true'
    attachments_host = "https://#{ENV['S3_ALIAS_HOST'] || ENV['S3_CLOUDFRONT_HOST'] || ENV['S3_HOSTNAME'] || "s3-#{ENV['S3_REGION'] || 'us-east-1'}.amazonaws.com"}"
    attachments_host = "https://#{Addressable::URI.parse(attachments_host).host}"
  elsif ENV['SWIFT_ENABLED'] == 'true'
    attachments_host = ENV['SWIFT_OBJECT_URL']
    attachments_host = "https://#{Addressable::URI.parse(attachments_host).host}"
  else
    attachments_host = nil
  end

  data_hosts << attachments_host unless attachments_host.nil?

  if ENV['PAPERCLIP_ROOT_URL']
    url = Addressable::URI.parse(assets_host) + ENV['PAPERCLIP_ROOT_URL']
    data_hosts << "https://#{url.host}"
  end<commit_msg>Revert "fix csp"<commit_after># Define an application-wide content security policy
# For further information see the following documentation
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy

if Rails.env.production?
  assets_host = Rails.configuration.action_controller.asset_host || "https://#{ENV['WEB_DOMAIN'] || ENV['LOCAL_DOMAIN']}"
  data_hosts = [assets_host]

  if ENV['S3_ENABLED'] == 'true'
    attachments_host = "https://#{ENV['S3_ALIAS_HOST'] || ENV['S3_CLOUDFRONT_HOST'] || ENV['S3_HOSTNAME'] || "s3-#{ENV['S3_REGION'] || 'us-east-1'}.amazonaws.com"}"
    attachments_host = "https://#{Addressable::URI.parse(attachments_host).host}"
  elsif ENV['SWIFT_ENABLED'] == 'true'
    attachments_host = ENV['SWIFT_OBJECT_URL']
    attachments_host = "https://#{Addressable::URI.parse(attachments_host).host}"
  else
    attachments_host = nil
  end

  data_hosts << attachments_host unless attachments_host.nil?

  if ENV['PAPERCLIP_ROOT_URL']
    url = Addressable::URI.parse(assets_host) + ENV['PAPERCLIP_ROOT_URL']
    data_hosts << "https://#{url.host}"
  end
{'fraction_non_alphanumeric': 0.16303400174367916, 'fraction_numerical': 0.006102877070619006, 'mean_word_length': 5.428571428571429, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 3, 'https://': 14, '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': '2971149', 'n_tokens_mistral': 823, 'n_tokens_neox': 817, 'n_words': 119}