Fix incorrect rate limit on PUT requests (#31356)

This commit is contained in:
Claire 2024-08-09 16:48:05 +02:00 committed by KMY
parent 63f4a2d1c4
commit fc77844266

View file

@ -144,7 +144,7 @@ class Rack::Attack
API_CREATE_EMOJI_REACTION_REGEX = %r{\A/api/v1/statuses/\d+/emoji_reactions}
throttle('throttle_password_change/account', limit: 10, period: 10.minutes) do |req|
req.warden_user_id if (req.put? && !req.path.match?(API_CREATE_EMOJI_REACTION_REGEX)) || (req.patch? && req.path_matches?('/auth'))
req.warden_user_id if (req.put? || req.patch?) && (req.path_matches?('/auth') || req.path_matches?('/auth/password'))
end
self.throttled_responder = lambda do |request|