lib/secure_headers.rb
def content_security_policy_nonce(request, script_or_style)
      request.env[NONCE_KEY] ||= SecureRandom.base64(32).chomp
      nonce_key = script_or_style == ContentSecurityPolicy::SCRIPT_SRC ? :script_nonce : :style_nonce
      append_content_security_policy_directives(request, nonce_key => request.env[NONCE_KEY])
      request.env[NONCE_KEY]
    end
# Private: gets or creates a nonce for CSP.
#
# Returns the nonce
gets or creates a nonce for CSP.
Returns the nonce
gets or creates a nonce for CSP . Returns the nonce
def content_security_policy_nonce(request, script_or_style)
      request.env[NONCE_KEY] ||= SecureRandom.base64(32).chomp
      nonce_key = script_or_style == ContentSecurityPolicy::SCRIPT_SRC ? :script_nonce : :style_nonce
      append_content_security_policy_directives(request, nonce_key => request.env[NONCE_KEY])
      request.env[NONCE_KEY]
    end
def content_security_policy_nonce ( request , script_or_style ) request . env [ NONCE_KEY ] ||= SecureRandom . base64 ( 32 ) . chomp nonce_key = script_or_style == ContentSecurityPolicy :: SCRIPT_SRC ? :script_nonce : :style_nonce append_content_security_policy_directives ( request , nonce_key => request . env [ NONCE_KEY ] ) request . env [ NONCE_KEY ] end
Private: gets or creates a nonce for CSP.
Private : gets or creates a nonce for CSP .
request
script_or_style