<commit_before>class SubmissionsController < ApplicationController
  include SubmissionsHelper
  include RepositoryHelper
  before_action { authorize! }

  PERMITTED_IFRAME_SRC = %w[https://www.youtube.com https://drive.google.com https://docs.google.com].freeze
  content_security_policy only: [:repo_browser, :file_manager] do |p|
    # required because heic2any uses libheif which calls
    # eval (javascript) and creates an image as a blob.
    # TODO: remove this when possible
    p.script_src :self, "'strict-dynamic'", "'unsafe-eval'"
    p.img_src :self, :blob
    p.frame_src(*PERMITTED_IFRAME_SRC)
  end
<commit_msg>csp: Add :self to frame_src list<commit_after>class SubmissionsController < ApplicationController
  include SubmissionsHelper
  include RepositoryHelper
  before_action { authorize! }

  PERMITTED_IFRAME_SRC = ([:self] + %w[https://www.youtube.com https://drive.google.com https://docs.google.com]).freeze
  content_security_policy only: [:repo_browser, :file_manager] do |p|
    # required because heic2any uses libheif which calls
    # eval (javascript) and creates an image as a blob.
    # TODO: remove this when possible
    p.script_src :self, "'strict-dynamic'", "'unsafe-eval'"
    p.img_src :self, :blob
    p.frame_src(*PERMITTED_IFRAME_SRC)
  end

{'fraction_non_alphanumeric': 0.10567210567210568, 'fraction_numerical': 0.001554001554001554, 'mean_word_length': 4.551724137931035, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 2, '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': '514396', 'n_tokens_mistral': 414, 'n_tokens_neox': 405, 'n_words': 104}