Skip to content

Commit 3b56350

Browse files
committed
Fix mastodon#6 - Rate limit GET reqs to 300/5min, POST to 100/5min
1 parent db6df6d commit 3b56350

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

config/initializers/rack-attack.rb

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
class Rack::Attack
2-
throttle('req/ip', limit: 300, period: 5.minutes) do |req|
3-
req.ip
2+
throttle('get-req/ip', limit: 300, period: 5.minutes) do |req|
3+
req.ip if req.get?
4+
end
5+
6+
throttle('post-req/ip', limit: 100, period: 5.minutes) do |req|
7+
req.ip if req.post?
48
end
59
end

0 commit comments

Comments
 (0)