0
0
Fork 0

Drop EOL Ruby 2.7 (#24237)

This commit is contained in:
Nick Schonning 2023-04-26 19:46:18 -04:00 committed by GitHub
parent d8a06c1375
commit 49fad26eca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 12 additions and 27 deletions

View file

@ -98,8 +98,8 @@ class Rack::Attack
req.throttleable_remote_ip if req.paging_request? && req.unauthenticated?
end
API_DELETE_REBLOG_REGEX = /\A\/api\/v1\/statuses\/[\d]+\/unreblog\z/.freeze
API_DELETE_STATUS_REGEX = /\A\/api\/v1\/statuses\/[\d]+\z/.freeze
API_DELETE_REBLOG_REGEX = /\A\/api\/v1\/statuses\/[\d]+\/unreblog\z/
API_DELETE_STATUS_REGEX = /\A\/api\/v1\/statuses\/[\d]+\z/
throttle('throttle_api_delete', limit: 30, period: 30.minutes) do |req|
req.authenticated_user_id if (req.post? && req.path.match?(API_DELETE_REBLOG_REGEX)) || (req.delete? && req.path.match?(API_DELETE_STATUS_REGEX))