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