Commit bb71c5d89f8bfd8a8047bf7056ad4b518c87ac64
1 parent
4525fc84
Exists in
master
and in
4 other branches
No limits when testing.
Showing
1 changed file
with
5 additions
and
2 deletions
Show diff stats
config/initializers/rack_attack.rb.example
| @@ -7,6 +7,9 @@ paths_to_be_protected = [ | @@ -7,6 +7,9 @@ paths_to_be_protected = [ | ||
| 7 | "#{Rails.application.config.relative_url_root}/users/sign_in", | 7 | "#{Rails.application.config.relative_url_root}/users/sign_in", |
| 8 | "#{Rails.application.config.relative_url_root}/users" | 8 | "#{Rails.application.config.relative_url_root}/users" |
| 9 | ] | 9 | ] |
| 10 | -Rack::Attack.throttle('protected paths', limit: 6, period: 60.seconds) do |req| | ||
| 11 | - req.ip if paths_to_be_protected.include?(req.path) && req.post? | 10 | + |
| 11 | +unless Rails.env.test? | ||
| 12 | + Rack::Attack.throttle('protected paths', limit: 6, period: 60.seconds) do |req| | ||
| 13 | + req.ip if paths_to_be_protected.include?(req.path) && req.post? | ||
| 14 | + end | ||
| 12 | end | 15 | end |