diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2016-01-06 02:55:10 -0200 |
---|---|---|
committer | Rafael França <rafaelmfranca@gmail.com> | 2016-01-06 02:55:10 -0200 |
commit | ced9612b59d1a8fdd38ac1669cf1e6bd43220a24 (patch) | |
tree | 7538e45b68b9d25cd6903cd3eb690a1fc3dfdf43 /railties | |
parent | 5c9a0a4a082a474a7bc0a5dabc390eea22a294ea (diff) | |
parent | 3e98819e20bc113343d4d4c0df614865ad5a9d3a (diff) | |
download | rails-ced9612b59d1a8fdd38ac1669cf1e6bd43220a24.tar.gz rails-ced9612b59d1a8fdd38ac1669cf1e6bd43220a24.tar.bz2 rails-ced9612b59d1a8fdd38ac1669cf1e6bd43220a24.zip |
Merge pull request #22275 from mastahyeti/per-form-csrf
Per-form CSRF tokens
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/generators/rails/app/templates/config/initializers/per_form_csrf_tokens.rb | 4 | ||||
-rw-r--r-- | railties/test/application/configuration_test.rb | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/railties/lib/rails/generators/rails/app/templates/config/initializers/per_form_csrf_tokens.rb b/railties/lib/rails/generators/rails/app/templates/config/initializers/per_form_csrf_tokens.rb new file mode 100644 index 0000000000..1f569dedfd --- /dev/null +++ b/railties/lib/rails/generators/rails/app/templates/config/initializers/per_form_csrf_tokens.rb @@ -0,0 +1,4 @@ +# Be sure to restart your server when you modify this file. + +# Enable per-form CSRF tokens. +Rails.application.config.action_controller.per_form_csrf_tokens = true diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb index 50d343865c..af3a391cc4 100644 --- a/railties/test/application/configuration_test.rb +++ b/railties/test/application/configuration_test.rb @@ -657,7 +657,7 @@ module ApplicationTests private - def form_authenticity_token; token; end # stub the authenticy token + def form_authenticity_token(*args); token; end # stub the authenticy token end RUBY |