instance method
sandbox
Ruby on Rails 8.1.2
Since v5.2.8.1Signature
sandbox(*values)
Specify whether a sandbox should be enabled for the requested resource:
policy.sandbox
Values can be passed as arguments:
policy.sandbox "allow-scripts", "allow-modals"
Pass false to disable the sandbox:
policy.sandbox false
Parameters
-
valuesrest
Source
# File actionpack/lib/action_dispatch/http/content_security_policy.rb, line 273
def sandbox(*values)
if values.empty?
@directives["sandbox"] = true
elsif values.first
@directives["sandbox"] = values
else
@directives.delete("sandbox")
end
end
Defined in actionpack/lib/action_dispatch/http/content_security_policy.rb line 273
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionDispatch::ContentSecurityPolicy