pull/30447/merge
Mia Heidenstedt 2025-01-08 17:05:03 +00:00 committed by GitHub
commit 56b2aa7063
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 2 deletions

View File

@ -82,8 +82,12 @@ class Rack::Attack
req.authenticated_user_id if req.post? && req.path.match?(%r{\A/api/v\d+/media\z}i)
end
throttle('throttle_media_proxy', limit: 30, period: 10.minutes) do |req|
req.throttleable_remote_ip if req.path.start_with?('/media_proxy')
throttle('throttle_authenticated_media_proxy', limit: 200, period: 10.minutes) do |req|
req.authenticated_user_id if req.path.start_with?('/media_proxy')
end
throttle('throttle_unauthenticated_media_proxy', limit: 30, period: 10.minutes) do |req|
req.throttleable_remote_ip if req.path.start_with?('/media_proxy') && req.unauthenticated?
end
throttle('throttle_api_sign_up', limit: 5, period: 30.minutes) do |req|