Module: ActionDispatch::ContentSecurityPolicy::Request
- Included in:
- Request
- Defined in:
- lib/action_dispatch/http/content_security_policy.rb
Constant Summary collapse
- POLICY =
"action_dispatch.content_security_policy"
- POLICY_REPORT_ONLY =
"action_dispatch.content_security_policy_report_only"
- NONCE_GENERATOR =
"action_dispatch.content_security_policy_nonce_generator"
- NONCE =
"action_dispatch.content_security_policy_nonce"
- NONCE_DIRECTIVES =
"action_dispatch.content_security_policy_nonce_directives"
Instance Method Summary collapse
- #content_security_policy ⇒ Object
- #content_security_policy=(policy) ⇒ Object
- #content_security_policy_nonce ⇒ Object
- #content_security_policy_nonce_directives ⇒ Object
- #content_security_policy_nonce_directives=(generator) ⇒ Object
- #content_security_policy_nonce_generator ⇒ Object
- #content_security_policy_nonce_generator=(generator) ⇒ Object
- #content_security_policy_report_only ⇒ Object
- #content_security_policy_report_only=(value) ⇒ Object
Instance Method Details
#content_security_policy ⇒ Object
78 79 80 |
# File 'lib/action_dispatch/http/content_security_policy.rb', line 78 def content_security_policy get_header(POLICY) end |
#content_security_policy=(policy) ⇒ Object
82 83 84 |
# File 'lib/action_dispatch/http/content_security_policy.rb', line 82 def content_security_policy=(policy) set_header(POLICY, policy) end |
#content_security_policy_nonce ⇒ Object
110 111 112 113 114 115 116 117 118 |
# File '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 |
#content_security_policy_nonce_directives ⇒ Object
102 103 104 |
# File 'lib/action_dispatch/http/content_security_policy.rb', line 102 def content_security_policy_nonce_directives get_header(NONCE_DIRECTIVES) end |
#content_security_policy_nonce_directives=(generator) ⇒ Object
106 107 108 |
# File 'lib/action_dispatch/http/content_security_policy.rb', line 106 def content_security_policy_nonce_directives=(generator) set_header(NONCE_DIRECTIVES, generator) end |
#content_security_policy_nonce_generator ⇒ Object
94 95 96 |
# File 'lib/action_dispatch/http/content_security_policy.rb', line 94 def content_security_policy_nonce_generator get_header(NONCE_GENERATOR) end |
#content_security_policy_nonce_generator=(generator) ⇒ Object
98 99 100 |
# File 'lib/action_dispatch/http/content_security_policy.rb', line 98 def content_security_policy_nonce_generator=(generator) set_header(NONCE_GENERATOR, generator) end |
#content_security_policy_report_only ⇒ Object
86 87 88 |
# File 'lib/action_dispatch/http/content_security_policy.rb', line 86 def content_security_policy_report_only get_header(POLICY_REPORT_ONLY) end |
#content_security_policy_report_only=(value) ⇒ Object
90 91 92 |
# File 'lib/action_dispatch/http/content_security_policy.rb', line 90 def content_security_policy_report_only=(value) set_header(POLICY_REPORT_ONLY, value) end |