From 9f5ac379c76c278ee9ee1662e26c4612b0a117bd Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 11 Feb 2021 12:08:52 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- app/controllers/projects/notes_controller.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'app/controllers/projects/notes_controller.rb') diff --git a/app/controllers/projects/notes_controller.rb b/app/controllers/projects/notes_controller.rb index 0b1d7d24d21..71a93701dc4 100644 --- a/app/controllers/projects/notes_controller.rb +++ b/app/controllers/projects/notes_controller.rb @@ -94,8 +94,7 @@ class Projects::NotesController < Projects::ApplicationController def create_rate_limit key = :notes_create - - return unless rate_limiter.throttled?(key, scope: [current_user]) + return unless rate_limiter.throttled?(key, scope: [current_user], users_allowlist: rate_limit_users_allowlist) rate_limiter.log_request(request, "#{key}_request_limit".to_sym, current_user) render plain: _('This endpoint has been requested too many times. Try again later.'), status: :too_many_requests @@ -104,4 +103,8 @@ class Projects::NotesController < Projects::ApplicationController def rate_limiter ::Gitlab::ApplicationRateLimiter end + + def rate_limit_users_allowlist + Gitlab::CurrentSettings.current_application_settings.notes_create_limit_allowlist + end end -- cgit v1.2.3