Add prefill api to rack_attack
This commit is contained in:
parent
490a997e97
commit
493a60f221
1 changed files with 6 additions and 0 deletions
|
@ -17,6 +17,12 @@ class Rack::Attack
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
throttle('/api/public/v1/dossiers/ip', limit: 5, period: 20.seconds) do |req|
|
||||||
|
if req.path == '/api/public/v1/dossiers' && req.post? && rack_attack_enabled?
|
||||||
|
req.remote_ip
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
Rack::Attack.safelist('allow from localhost') do |req|
|
Rack::Attack.safelist('allow from localhost') do |req|
|
||||||
IPService.ip_trusted?(req.remote_ip)
|
IPService.ip_trusted?(req.remote_ip)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue