diff options
author | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2018-05-03 11:38:17 +0900 |
---|---|---|
committer | Yuji Yaginuma <yuuji.yaginuma@gmail.com> | 2018-05-03 15:46:03 +0900 |
commit | 1007191f31d7ce8486f1f32a5d700bbac66ae242 (patch) | |
tree | fe022c99fb49e71e8d050da744197fbbe084b958 /actionpack/test | |
parent | 847342c25c61acaea988430dc3ab66a82e3ed486 (diff) | |
download | rails-1007191f31d7ce8486f1f32a5d700bbac66ae242.tar.gz rails-1007191f31d7ce8486f1f32a5d700bbac66ae242.tar.bz2 rails-1007191f31d7ce8486f1f32a5d700bbac66ae242.zip |
Add support for prefetch-src directive
Specification: https://w3c.github.io/webappsec-csp/#directive-prefetch-src
This directive can already be used as an experimental feature in Chrome.
Ref: https://bugs.chromium.org/p/chromium/issues/detail?id=801561
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/dispatch/content_security_policy_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/content_security_policy_test.rb b/actionpack/test/dispatch/content_security_policy_test.rb index c4c7f53903..4f9a4ff2bd 100644 --- a/actionpack/test/dispatch/content_security_policy_test.rb +++ b/actionpack/test/dispatch/content_security_policy_test.rb @@ -116,6 +116,12 @@ class ContentSecurityPolicyTest < ActiveSupport::TestCase @policy.object_src false assert_no_match %r{object-src}, @policy.build + @policy.prefetch_src :self + assert_match %r{prefetch-src 'self'}, @policy.build + + @policy.prefetch_src false + assert_no_match %r{prefetch-src}, @policy.build + @policy.script_src :self assert_match %r{script-src 'self'}, @policy.build |