diff options
author | Valery Sizov <valery@gitlab.com> | 2018-05-29 15:25:43 +0300 |
---|---|---|
committer | Valery Sizov <valery@gitlab.com> | 2018-05-29 15:25:43 +0300 |
commit | 64679a0d9a654d4df88af45b7fdd4e322091f51e (patch) | |
tree | e79ae4f486ce05e403276545163ecfac8bc6a3e4 /config | |
parent | 4af756e5269ae3975add615ddf286447258cf583 (diff) |
Backport of https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/5876
Diffstat (limited to 'config')
-rw-r--r-- | config/initializers/rack_attack_global.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/config/initializers/rack_attack_global.rb b/config/initializers/rack_attack_global.rb index a90516eee7d..45963831c41 100644 --- a/config/initializers/rack_attack_global.rb +++ b/config/initializers/rack_attack_global.rb @@ -26,7 +26,7 @@ class Rack::Attack throttle('throttle_unauthenticated', Gitlab::Throttle.unauthenticated_options) do |req| Gitlab::Throttle.settings.throttle_unauthenticated_enabled && req.unauthenticated? && - !req.api_internal_request? && + !req.should_be_skipped? && req.ip end @@ -59,6 +59,10 @@ class Rack::Attack path =~ %r{^/api/v\d+/internal/} end + def should_be_skipped? + api_internal_request? + end + def web_request? !api_request? end |