From 74fa9205c0ec09ded34dfdc1fb55e407fb7c464c Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Fri, 18 Oct 2019 08:06:27 +0500 Subject: [PATCH] Rack::Attack middleware is now used by default --- config/environments/production.rb | 3 --- config/environments/staging.rb | 3 --- features/support/env.rb | 2 ++ spec/rails_helper.rb | 2 ++ 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/config/environments/production.rb b/config/environments/production.rb index bc17e3a..8efc2bc 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -117,7 +117,4 @@ Rails.application.configure do # Do not dump schema after migrations. config.active_record.dump_schema_after_migration = false - - # Middleware. - config.middleware.use Rack::Attack end diff --git a/config/environments/staging.rb b/config/environments/staging.rb index 734c10b..2fb844a 100644 --- a/config/environments/staging.rb +++ b/config/environments/staging.rb @@ -117,7 +117,4 @@ Rails.application.configure do # Do not dump schema after migrations. config.active_record.dump_schema_after_migration = false - - # Middleware. - config.middleware.use Rack::Attack end diff --git a/features/support/env.rb b/features/support/env.rb index 645924e..e225ccf 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -41,3 +41,5 @@ end # recommended as it will mask a lot of errors for you! # ActionController::Base.allow_rescue = false + +Rack::Attack.enabled = false diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index b06dc87..f503b82 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -51,6 +51,8 @@ end ActiveJob::Base.queue_adapter = :test +Rack::Attack.enabled = false + RSpec.configure do |config| # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures config.fixture_path = Rails.root.join('fixtures').to_s