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:
Diffstat (limited to 'lib/gitlab/rack_attack.rb')
-rw-r--r--lib/gitlab/rack_attack.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/gitlab/rack_attack.rb b/lib/gitlab/rack_attack.rb
index b2664f87306..f5fb6b5af3d 100644
--- a/lib/gitlab/rack_attack.rb
+++ b/lib/gitlab/rack_attack.rb
@@ -12,9 +12,9 @@ module Gitlab
rack_attack::Request.include(Gitlab::RackAttack::Request)
# This is Rack::Attack::DEFAULT_THROTTLED_RESPONSE, modified to allow a custom response
- rack_attack.throttled_response = lambda do |env|
+ rack_attack.throttled_responder = lambda do |request|
throttled_headers = Gitlab::RackAttack.throttled_response_headers(
- env['rack.attack.matched'], env['rack.attack.match_data']
+ request.env['rack.attack.matched'], request.env['rack.attack.match_data']
)
[429, { 'Content-Type' => 'text/plain' }.merge(throttled_headers), [Gitlab::Throttle.rate_limiting_response_text]]
end