Skip to content

Commit

Permalink
Fix Rack::Attack disabling
Browse files Browse the repository at this point in the history
  • Loading branch information
Kagemaru committed May 10, 2023
1 parent 58053f5 commit 80e3f0e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion config/initializers/rack-attack.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'rack/attack'
require 'ipaddr'

Rack::Attack.enabled = ENV['ENABLE_RACK_ATTACK']&.in?(%w[true 1]) || Rails.env.production?
Rack::Attack.enabled = ENV.fetch('ENABLE_RACK_ATTACK', Rails.env.production?.to_s).in?(%w[true 1])

ActiveSupport::Notifications.subscribe(/rack_attack/) do |name, start, finish, request_id, payload|
# request object available in payload[:request]
Expand Down

0 comments on commit 80e3f0e

Please sign in to comment.