]> cat aescling's git repositories - mastodon.git/commitdiff
Increase rate limit on protected paths (#6229)
authorEugen Rochko <eugen@zeonfederated.com>
Tue, 9 Jan 2018 16:07:54 +0000 (17:07 +0100)
committerGitHub <noreply@github.com>
Tue, 9 Jan 2018 16:07:54 +0000 (17:07 +0100)
Previously each protected path had a separate rate limit. Now they're all in the same bucket, so people are more likely to hit one with register->login. Increasing to 25 per 5 minutes should be fine.

config/initializers/rack_attack.rb

index b38fb302b2eb2ef4c81549a1346a227855671cb8..b35452f04f478ae9cecb2cba5c36dcd3224d7d30 100644 (file)
@@ -53,7 +53,7 @@ class Rack::Attack
     req.ip if req.api_request?
   end
 
-  throttle('protected_paths', limit: 5, period: 5.minutes) do |req|
+  throttle('protected_paths', limit: 25, period: 5.minutes) do |req|
     req.ip if req.post? && req.path =~ PROTECTED_PATHS_REGEX
   end