<commit_before>if defined?(SecureHeaders)
  SecureHeaders::Configuration.default do |config|
    config.hsts = "max-age=#{20.years.to_i}"
    config.x_frame_options = 'SAMEORIGIN'
    config.x_content_type_options = "nosniff"
    config.x_xss_protection = "1; mode=block"
    config.csp = {
      :report_only => false,
      :default_src => ["'self'"],
      :frame_src   => ["'self'"],
      :font_src    => ["'self'", 'https://fonts.gstatic.com'],
      :connect_src => ["'self'"],
      :style_src   => ["'unsafe-inline'", "'self'"],
      :script_src  => ["'unsafe-eval'", "'unsafe-inline'", "'self'"],
      :report_uri  => ["/dashboard/csp_report"]
    }
  end
end
<commit_msg>make secure header values more grep friendly<commit_after>if defined?(SecureHeaders)
  # Please make sure these values are properly reflected in apache config:
  # - https://github.com/ManageIQ/manageiq-appliance/blob/master/COPY/etc/httpd/conf.d/manageiq-https-application.conf
  # - https://github.com/ManageIQ/manageiq-pods/blob/master/manageiq-operator/pkg/helpers/miq-components/httpd_conf.go
  SecureHeaders::Configuration.default do |config|
    config.hsts = "max-age=#{20.years.to_i}"
    # X-Frame-Options
    config.x_frame_options = 'SAMEORIGIN'
    # X-Content-Type-Options
    config.x_content_type_options = "nosniff"
    # X-XSS-Protection
    # X-Permitted-Cross-Domain-Policies
    config.x_xss_protection = "1; mode=block"
    # Content-Security-Policy
    config.csp = {
      :report_only => false,
      :default_src => ["'self'"],
      :frame_src   => ["'self'"],
      :font_src    => ["'self'", 'https://fonts.gstatic.com'],
      :connect_src => ["'self'"],
      :style_src   => ["'unsafe-inline'", "'self'"],
      :script_src  => ["'unsafe-eval'", "'unsafe-inline'", "'self'"],
      :report_uri  => ["/dashboard/csp_report"]
    }
  end
end

{'fraction_non_alphanumeric': 0.18157327586206898, 'fraction_numerical': 0.003232758620689655, 'mean_word_length': 3.431980906921241, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, 'https://': 4, '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': '4107735', 'n_tokens_mistral': 671, 'n_tokens_neox': 660, 'n_words': 98}