Methods

Constants

NONCE = "action_dispatch.content_security_policy_nonce".freeze
NONCE_GENERATOR = "action_dispatch.content_security_policy_nonce_generator".freeze
POLICY = "action_dispatch.content_security_policy".freeze
POLICY_REPORT_ONLY = "action_dispatch.content_security_policy_report_only".freeze

Instance Public methods

content_security_policy()

📝 Source code
# File actionpack/lib/action_dispatch/http/content_security_policy.rb, line 51
      def content_security_policy
        get_header(POLICY)
      end
🔎 See on GitHub

content_security_policy=(policy)

📝 Source code
# File actionpack/lib/action_dispatch/http/content_security_policy.rb, line 55
      def content_security_policy=(policy)
        set_header(POLICY, policy)
      end
🔎 See on GitHub

content_security_policy_nonce()

📝 Source code
# File actionpack/lib/action_dispatch/http/content_security_policy.rb, line 75
      def content_security_policy_nonce
        if content_security_policy_nonce_generator
          if nonce = get_header(NONCE)
            nonce
          else
            set_header(NONCE, generate_content_security_policy_nonce)
          end
        end
      end
🔎 See on GitHub

content_security_policy_nonce_generator()

📝 Source code
# File actionpack/lib/action_dispatch/http/content_security_policy.rb, line 67
      def content_security_policy_nonce_generator
        get_header(NONCE_GENERATOR)
      end
🔎 See on GitHub

content_security_policy_nonce_generator=(generator)

📝 Source code
# File actionpack/lib/action_dispatch/http/content_security_policy.rb, line 71
      def content_security_policy_nonce_generator=(generator)
        set_header(NONCE_GENERATOR, generator)
      end
🔎 See on GitHub

content_security_policy_report_only()

📝 Source code
# File actionpack/lib/action_dispatch/http/content_security_policy.rb, line 59
      def content_security_policy_report_only
        get_header(POLICY_REPORT_ONLY)
      end
🔎 See on GitHub

content_security_policy_report_only=(value)

📝 Source code
# File actionpack/lib/action_dispatch/http/content_security_policy.rb, line 63
      def content_security_policy_report_only=(value)
        set_header(POLICY_REPORT_ONLY, value)
      end
🔎 See on GitHub