feat: common attachment endpoint follow-up changes (#7826)
This commit is contained in:
@@ -137,6 +137,11 @@ class Rack::Attack
|
||||
match_data[:account_id] if match_data.present?
|
||||
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?
|
||||
end
|
||||
|
||||
## ----------------------------------------------- ##
|
||||
end
|
||||
|
||||
|
||||
@@ -58,11 +58,9 @@ Rails.application.routes.draw do
|
||||
resources :canned_responses, only: [:index, :create, :update, :destroy]
|
||||
resources :automation_rules, only: [:index, :create, :show, :update, :destroy] do
|
||||
post :clone
|
||||
post :attach_file, on: :collection
|
||||
end
|
||||
resources :macros, only: [:index, :create, :show, :update, :destroy] do
|
||||
post :execute, on: :member
|
||||
post :attach_file, on: :collection
|
||||
end
|
||||
resources :sla_policies, only: [:index, :create, :show, :update, :destroy]
|
||||
resources :campaigns, only: [:index, :create, :show, :update, :destroy]
|
||||
@@ -214,10 +212,8 @@ Rails.application.routes.draw do
|
||||
patch :archive
|
||||
put :add_members
|
||||
end
|
||||
post :attach_file, on: :collection
|
||||
resources :categories
|
||||
resources :articles do
|
||||
post :attach_file, on: :collection
|
||||
post :reorder, on: :collection
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user