Skip to content

Commit

Permalink
Fix Blocklist each ip separately (#463)
Browse files Browse the repository at this point in the history
* Blocklist each ip separately

* Rubocopify
  • Loading branch information
tramuntanal authored Jan 30, 2024
1 parent ae483eb commit 6965e19
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion config/initializers/rack_attack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@
end
end

Rack::Attack.blocklist_ip(ENV["RACK_ATTACK_BLOCKED_IPS"].split(",")) if ENV["RACK_ATTACK_BLOCKED_IPS"].present?
if ENV["RACK_ATTACK_BLOCKED_IPS"].present?
ENV["RACK_ATTACK_BLOCKED_IPS"].split(",").each do |ip_or_subnet|
Rack::Attack.blocklist_ip(ip_or_subnet)
end
end
end

__END__
Expand Down

0 comments on commit 6965e19

Please sign in to comment.