Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-09-17 18:11:44 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-09-17 18:11:44 +0300
commit3b9468e8b913d43f45e472b69b98c9da05f338bb (patch)
treea74e3d2a5b71a1e2a96c3751a04e9a78d36ee6f5 /lib/gitlab/rack_attack
parentbb5c4817e58efb92d6be81e028d55adc9626e5da (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/rack_attack')
-rw-r--r--lib/gitlab/rack_attack/request.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/gitlab/rack_attack/request.rb b/lib/gitlab/rack_attack/request.rb
index 9deba0c7ca1..099174842d0 100644
--- a/lib/gitlab/rack_attack/request.rb
+++ b/lib/gitlab/rack_attack/request.rb
@@ -60,6 +60,12 @@ module Gitlab
path =~ protected_paths_regex
end
+ def throttle?(throttle, authenticated:)
+ fragment = Gitlab::Throttle.throttle_fragment!(throttle, authenticated: authenticated)
+
+ __send__("#{fragment}?") # rubocop:disable GitlabSecurity/PublicSend
+ end
+
def throttle_unauthenticated_api?
api_request? &&
!should_be_skipped? &&