Skip to content

Commit

Permalink
fix rubocop warning in rack_attack initializer
Browse files Browse the repository at this point in the history
  • Loading branch information
briri committed Mar 24, 2023
1 parent d067a9f commit 668b67d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config/initializers/rack_attack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
Rack::Attack.cache.store = ActiveSupport::Cache::MemoryStore.new # defaults to Rails.cache

# Throttle should send a 429 Error responsec code and display public/429.html
Rack::Attack.throttled_responder = lambda do |env|
Rack::Attack.throttled_responder = lambda do |_env|
html = ActionView::Base.empty.render(file: 'public/429.html')
[429, {'Content-Type' => 'text/html'}, [html]]
[429, { 'Content-Type' => 'text/html' }, [html]]
end

# Throttle attempts to a particular path. 2 POSTs to /users/password every 30 seconds
Expand Down

0 comments on commit 668b67d

Please sign in to comment.