Commit 64679a0d authored by Valery Sizov's avatar Valery Sizov
parent 4af756e5
...@@ -26,7 +26,7 @@ class Rack::Attack ...@@ -26,7 +26,7 @@ class Rack::Attack
throttle('throttle_unauthenticated', Gitlab::Throttle.unauthenticated_options) do |req| throttle('throttle_unauthenticated', Gitlab::Throttle.unauthenticated_options) do |req|
Gitlab::Throttle.settings.throttle_unauthenticated_enabled && Gitlab::Throttle.settings.throttle_unauthenticated_enabled &&
req.unauthenticated? && req.unauthenticated? &&
!req.api_internal_request? && !req.should_be_skipped? &&
req.ip req.ip
end end
...@@ -59,6 +59,10 @@ class Rack::Attack ...@@ -59,6 +59,10 @@ class Rack::Attack
path =~ %r{^/api/v\d+/internal/} path =~ %r{^/api/v\d+/internal/}
end end
def should_be_skipped?
api_internal_request?
end
def web_request? def web_request?
!api_request? !api_request?
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment