1
0
mirror of https://github.com/funamitech/mastodon synced 2024-12-01 08:18:53 +09:00

Fix #6 - Rate limit GET reqs to 300/5min, POST to 100/5min

This commit is contained in:
Eugen Rochko 2016-09-24 13:53:54 +02:00
parent db6df6ddb3
commit 3b56350121

View File

@ -1,5 +1,9 @@
class Rack::Attack class Rack::Attack
throttle('req/ip', limit: 300, period: 5.minutes) do |req| throttle('get-req/ip', limit: 300, period: 5.minutes) do |req|
req.ip req.ip if req.get?
end
throttle('post-req/ip', limit: 100, period: 5.minutes) do |req|
req.ip if req.post?
end end
end end