Sha256: 9c718f51c0ee1718369c4dfc200f77e7435fa5c6414304b8d6d29a9a98b4c706

Contents?: true

Size: 512 Bytes

Versions: 7

Compression:

Stored size: 512 Bytes

Contents

# frozen_string_literal: true

require "active_support/concern"

module Decidim
  module Elections
    module ContentSecurityPolicy
      extend ActiveSupport::Concern

      included do
        before_action :append_csp_directives
      end

      private

      def append_csp_directives
        return unless Decidim::Elections.bulletin_board.configured?

        content_security_policy.append_csp_directive("connect-src", Decidim::Elections.bulletin_board.bulletin_board_server)
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
decidim-elections-0.28.4 app/controllers/concerns/decidim/elections/content_security_policy.rb
decidim-elections-0.28.3 app/controllers/concerns/decidim/elections/content_security_policy.rb
decidim-elections-0.28.2 app/controllers/concerns/decidim/elections/content_security_policy.rb
decidim-elections-0.28.1 app/controllers/concerns/decidim/elections/content_security_policy.rb
decidim-elections-0.28.0 app/controllers/concerns/decidim/elections/content_security_policy.rb
decidim-elections-0.28.0.rc5 app/controllers/concerns/decidim/elections/content_security_policy.rb
decidim-elections-0.28.0.rc4 app/controllers/concerns/decidim/elections/content_security_policy.rb