Skip to Content Skip to Search

module ActionDispatch::ContentSecurityPolicy::Request

Constants

"action_dispatch.content_security_policy_nonce"
"action_dispatch.content_security_policy_nonce_directives"
"action_dispatch.content_security_policy_nonce_generator"
"action_dispatch.content_security_policy"
"action_dispatch.content_security_policy_report_only"

Public instance methods

Source code GitHub
# File actionpack/lib/action_dispatch/http/content_security_policy.rb, line 78
def content_security_policy
  get_header(POLICY)
end
Source code GitHub
# File actionpack/lib/action_dispatch/http/content_security_policy.rb, line 82
def content_security_policy=(policy)
  set_header(POLICY, policy)
end
Source code GitHub
# File actionpack/lib/action_dispatch/http/content_security_policy.rb, line 110
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
Source code GitHub
# File actionpack/lib/action_dispatch/http/content_security_policy.rb, line 102
def content_security_policy_nonce_directives
  get_header(NONCE_DIRECTIVES)
end
Source code GitHub
# File actionpack/lib/action_dispatch/http/content_security_policy.rb, line 106
def content_security_policy_nonce_directives=(generator)
  set_header(NONCE_DIRECTIVES, generator)
end
Source code GitHub
# File actionpack/lib/action_dispatch/http/content_security_policy.rb, line 94
def content_security_policy_nonce_generator
  get_header(NONCE_GENERATOR)
end
Source code GitHub
# File actionpack/lib/action_dispatch/http/content_security_policy.rb, line 98
def content_security_policy_nonce_generator=(generator)
  set_header(NONCE_GENERATOR, generator)
end
Source code GitHub
# File actionpack/lib/action_dispatch/http/content_security_policy.rb, line 86
def content_security_policy_report_only
  get_header(POLICY_REPORT_ONLY)
end
Source code GitHub
# File actionpack/lib/action_dispatch/http/content_security_policy.rb, line 90
def content_security_policy_report_only=(value)
  set_header(POLICY_REPORT_ONLY, value)
end

Definition files