Sha256: 74cff038e013b25fcdcdc3f8e81b73b5d7412f24068e613c18d9583e6e8dbf9e

Contents?: true

Size: 627 Bytes

Versions: 13

Compression:

Stored size: 627 Bytes

Contents

# frozen_string_literal: true

require "active_support/concern"

module Decidim
  module Headers
    module ContentSecurityPolicy
      extend ActiveSupport::Concern

      included do
        def content_security_policy
          @content_security_policy ||= Decidim::ContentSecurityPolicy.new(current_organization, Decidim.content_security_policies_extra)
        end

        after_action :append_content_security_policy_headers
      end

      private

      def append_content_security_policy_headers
        response.headers["Content-Security-Policy"] = content_security_policy.output_policy
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
decidim-core-0.29.1 app/controllers/concerns/decidim/headers/content_security_policy.rb
decidim-core-0.28.4 app/controllers/concerns/decidim/headers/content_security_policy.rb
decidim-core-0.29.0 app/controllers/concerns/decidim/headers/content_security_policy.rb
decidim-core-0.28.3 app/controllers/concerns/decidim/headers/content_security_policy.rb
decidim-core-0.29.0.rc4 app/controllers/concerns/decidim/headers/content_security_policy.rb
decidim-core-0.29.0.rc3 app/controllers/concerns/decidim/headers/content_security_policy.rb
decidim-core-0.29.0.rc2 app/controllers/concerns/decidim/headers/content_security_policy.rb
decidim-core-0.29.0.rc1 app/controllers/concerns/decidim/headers/content_security_policy.rb
decidim-core-0.28.2 app/controllers/concerns/decidim/headers/content_security_policy.rb
decidim-core-0.28.1 app/controllers/concerns/decidim/headers/content_security_policy.rb
decidim-core-0.28.0 app/controllers/concerns/decidim/headers/content_security_policy.rb
decidim-core-0.28.0.rc5 app/controllers/concerns/decidim/headers/content_security_policy.rb
decidim-core-0.28.0.rc4 app/controllers/concerns/decidim/headers/content_security_policy.rb