diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-18 22:00:14 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-18 22:00:14 +0300 |
commit | 05f0ebba3a2c8ddf39e436f412dc2ab5bf1353b2 (patch) | |
tree | 11d0f2a6ec31c7793c184106cedc2ded3d9a2cc5 /lib/api/internal/base.rb | |
parent | ec73467c23693d0db63a797d10194da9e72a74af (diff) |
Add latest changes from gitlab-org/gitlab@15-8-stable-eev15.8.0-rc42
Diffstat (limited to 'lib/api/internal/base.rb')
-rw-r--r-- | lib/api/internal/base.rb | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/api/internal/base.rb b/lib/api/internal/base.rb index dbd5c5f9db1..3f6e052f7b6 100644 --- a/lib/api/internal/base.rb +++ b/lib/api/internal/base.rb @@ -44,16 +44,12 @@ module API # This is a separate method so that EE can alter its behaviour more # easily. - if Feature.enabled?(:rate_limit_gitlab_shell) - check_rate_limit!(:gitlab_shell_operation, scope: [params[:action], params[:project], actor.key_or_user]) - end + check_rate_limit!(:gitlab_shell_operation, scope: [params[:action], params[:project], actor.key_or_user]) - if Feature.enabled?(:rate_limit_gitlab_shell_by_ip, actor.user) - rate_limiter = Gitlab::Auth::IpRateLimiter.new(request.ip) + rate_limiter = Gitlab::Auth::IpRateLimiter.new(request.ip) - unless rate_limiter.trusted_ip? - check_rate_limit!(:gitlab_shell_operation, scope: [params[:action], params[:project], rate_limiter.ip]) - end + unless rate_limiter.trusted_ip? + check_rate_limit!(:gitlab_shell_operation, scope: [params[:action], params[:project], rate_limiter.ip]) end # Stores some Git-specific env thread-safely |