module ActionDispatch::ContentSecurityPolicy::Request

Constants

NONCE
NONCE_DIRECTIVES
NONCE_GENERATOR
POLICY
POLICY_REPORT_ONLY

Public Instance Methods

content_security_policy() click to toggle source
# File lib/action_dispatch/http/content_security_policy.rb, line 60
def content_security_policy
  get_header(POLICY)
end
content_security_policy=(policy) click to toggle source
# File lib/action_dispatch/http/content_security_policy.rb, line 64
def content_security_policy=(policy)
  set_header(POLICY, policy)
end
content_security_policy_nonce() click to toggle source
# File lib/action_dispatch/http/content_security_policy.rb, line 92
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
content_security_policy_nonce_directives() click to toggle source
# File lib/action_dispatch/http/content_security_policy.rb, line 84
def content_security_policy_nonce_directives
  get_header(NONCE_DIRECTIVES)
end
content_security_policy_nonce_directives=(generator) click to toggle source
# File lib/action_dispatch/http/content_security_policy.rb, line 88
def content_security_policy_nonce_directives=(generator)
  set_header(NONCE_DIRECTIVES, generator)
end
content_security_policy_nonce_generator() click to toggle source
# File lib/action_dispatch/http/content_security_policy.rb, line 76
def content_security_policy_nonce_generator
  get_header(NONCE_GENERATOR)
end
content_security_policy_nonce_generator=(generator) click to toggle source
# File lib/action_dispatch/http/content_security_policy.rb, line 80
def content_security_policy_nonce_generator=(generator)
  set_header(NONCE_GENERATOR, generator)
end
content_security_policy_report_only() click to toggle source
# File lib/action_dispatch/http/content_security_policy.rb, line 68
def content_security_policy_report_only
  get_header(POLICY_REPORT_ONLY)
end
content_security_policy_report_only=(value) click to toggle source
# File lib/action_dispatch/http/content_security_policy.rb, line 72
def content_security_policy_report_only=(value)
  set_header(POLICY_REPORT_ONLY, value)
end

Private Instance Methods

generate_content_security_policy_nonce() click to toggle source
# File lib/action_dispatch/http/content_security_policy.rb, line 103
def generate_content_security_policy_nonce
  content_security_policy_nonce_generator.call(self)
end