instance method
build_directives
Ruby on Rails 8.1.2
Since v5.2.8.1 PrivateSignature
build_directives(context, nonce, nonce_directives)
No documentation comment.
Parameters
-
contextreq -
noncereq -
nonce_directivesreq
Source
# File actionpack/lib/action_dispatch/http/content_security_policy.rb, line 330
def build_directives(context, nonce, nonce_directives)
@directives.map do |directive, sources|
if sources.is_a?(Array)
if nonce && nonce_directive?(directive, nonce_directives)
"#{directive} #{build_directive(directive, sources, context).join(' ')} 'nonce-#{nonce}'"
else
"#{directive} #{build_directive(directive, sources, context).join(' ')}"
end
elsif sources
directive
else
nil
end
end
end
Defined in actionpack/lib/action_dispatch/http/content_security_policy.rb line 330
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionDispatch::ContentSecurityPolicy