feat: Add upload under account scope (#7914)
This commit is contained in:
@@ -138,8 +138,9 @@ class Rack::Attack
|
||||
end
|
||||
|
||||
## Prevent Abuse of attachment upload APIs ##
|
||||
throttle('/api/v1/upload', limit: 60, period: 1.hour) do |req|
|
||||
req.ip if req.path_without_extentions == '/api/v1/upload' && req.post?
|
||||
throttle('/api/v1/accounts/:account_id/upload', limit: 60, period: 1.hour) do |req|
|
||||
match_data = %r{/api/v1/accounts/(?<account_id>\d+)/upload}.match(req.path)
|
||||
match_data[:account_id] if match_data.present?
|
||||
end
|
||||
|
||||
## ----------------------------------------------- ##
|
||||
|
||||
@@ -217,13 +217,13 @@ Rails.application.routes.draw do
|
||||
post :reorder, on: :collection
|
||||
end
|
||||
end
|
||||
|
||||
resources :upload, only: [:create]
|
||||
end
|
||||
end
|
||||
# end of account scoped api routes
|
||||
# ----------------------------------
|
||||
|
||||
resources :upload, only: [:create]
|
||||
|
||||
namespace :integrations do
|
||||
resources :webhooks, only: [:create]
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user