chore: Increase the rate limit for contact search (#9256)

This commit is contained in:
Pranav 2024-04-17 16:59:38 -07:00 committed by GitHub
parent 8fcf476206
commit 888d3cb3fa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -149,7 +149,7 @@ class Rack::Attack
end
## Prevent abuse of contact search api
throttle('/api/v1/accounts/:account_id/contacts/search', limit: 5, period: 1.minute) do |req|
throttle('/api/v1/accounts/:account_id/contacts/search', limit: ENV.fetch('RATE_LIMIT_CONTACT_SEARCH', '100').to_i, period: 1.minute) do |req|
match_data = %r{/api/v1/accounts/(?<account_id>\d+)/contacts/search}.match(req.path)
match_data[:account_id] if match_data.present?
end