#192: Checks ip address in api defender
This commit is contained in:
parent
8c3c524460
commit
e735c6e5f5
|
@ -51,7 +51,9 @@ class ApiDefender < Rack::Throttle::Hourly
|
||||||
|
|
||||||
# only API calls should be throttled
|
# only API calls should be throttled
|
||||||
def need_defense?(request)
|
def need_defense?(request)
|
||||||
request.env['PATH_INFO'] =~ /^\/api\/v1\// && !system_user?(request)
|
APP_CONFIG['allowed_addresses'].exclude?(request.ip) &&
|
||||||
|
request.env['PATH_INFO'] =~ /^\/api\/v1\// &&
|
||||||
|
!system_user?(request)
|
||||||
end
|
end
|
||||||
|
|
||||||
def authorized?(request)
|
def authorized?(request)
|
||||||
|
|
Loading…
Reference in New Issue