1
0
Fork 0
mirror of https://github.com/mastodon/mastodon.git synced 2024-08-20 21:08:15 -07:00

Change rate limit for media proxy

This commit is contained in:
老周部落 2023-01-03 18:55:47 +08:00 committed by GitHub
parent 41fe7576bf
commit 82acc07ceb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -74,7 +74,7 @@ class Rack::Attack
req.authenticated_user_id if req.post? && req.path.match?(/\A\/api\/v\d+\/media\z/i) req.authenticated_user_id if req.post? && req.path.match?(/\A\/api\/v\d+\/media\z/i)
end end
throttle('throttle_media_proxy', limit: 30, period: 10.minutes) do |req| throttle('throttle_media_proxy', limit: 300, period: 5.minutes) do |req|
req.throttleable_remote_ip if req.path.start_with?('/media_proxy') req.throttleable_remote_ip if req.path.start_with?('/media_proxy')
end end