instance method
resolve_source
Ruby on Rails 8.1.2
Since v5.2.8.1 PrivateSignature
resolve_source(source, context)
No documentation comment.
Parameters
-
sourcereq -
contextreq
Source
# File actionpack/lib/action_dispatch/http/content_security_policy.rb, line 364
def resolve_source(source, context)
case source
when String
source
when Symbol
source.to_s
when Proc
if context.nil?
raise RuntimeError, "Missing context for the dynamic content security policy source: #{source.inspect}"
else
resolved = context.instance_exec(&source)
apply_mappings(Array.wrap(resolved))
end
else
raise RuntimeError, "Unexpected content security policy source: #{source.inspect}"
end
end
Defined in actionpack/lib/action_dispatch/http/content_security_policy.rb line 364
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionDispatch::ContentSecurityPolicy