Skip to content

Commit

Permalink
Merge pull request #3887 from FrancescoAiello01/3873_forgery_protecti…
Browse files Browse the repository at this point in the history
…on_default

Set dummy app forgery protection to false
  • Loading branch information
kennyadsl authored Feb 15, 2021
2 parents 0e58e06 + 4c2f54a commit 0d2c83d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions core/lib/generators/spree/dummy/templates/rails/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
# Raise exceptions instead of rendering exception templates
config.action_dispatch.show_exceptions = false

# Disable request forgery protection in test environment
config.action_controller.allow_forgery_protection = false

# Tell Action Mailer not to deliver emails to the real world.
# The :test delivery method accumulates sent emails in the
# ActionMailer::Base.deliveries array.
Expand Down
5 changes: 3 additions & 2 deletions core/lib/spree/testing_support/dummy_app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

# @private
class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
end

# @private
Expand Down Expand Up @@ -52,8 +53,8 @@ class Application < ::Rails::Application
config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }
config.whiny_nils = true
config.consider_all_requests_local = true
config.action_controller.allow_forgery_protection = true
config.action_controller.default_protect_from_forgery = true
config.action_controller.allow_forgery_protection = false
config.action_controller.default_protect_from_forgery = false
config.action_controller.perform_caching = false
config.action_dispatch.show_exceptions = false
config.active_support.deprecation = :stderr
Expand Down

0 comments on commit 0d2c83d

Please sign in to comment.