diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-27 12:05:56 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-27 12:05:56 +0300 |
commit | cc5d0271c249636bae1de55de9c2bf815d669afa (patch) | |
tree | 01b5b05c2376fca5a854459460a317c5fef96889 /config/initializers/rack_attack_logging.rb | |
parent | 529bc7e23ba25fb310c73a3d47759bfdd8b97a0a (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'config/initializers/rack_attack_logging.rb')
-rw-r--r-- | config/initializers/rack_attack_logging.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/config/initializers/rack_attack_logging.rb b/config/initializers/rack_attack_logging.rb index be7c2175cb2..a95cb09755b 100644 --- a/config/initializers/rack_attack_logging.rb +++ b/config/initializers/rack_attack_logging.rb @@ -2,8 +2,10 @@ # # Adds logging for all Rack Attack blocks and throttling events. -ActiveSupport::Notifications.subscribe('rack.attack') do |name, start, finish, request_id, req| - if [:throttle, :blacklist].include? req.env['rack.attack.match_type'] +ActiveSupport::Notifications.subscribe(/rack_attack/) do |name, start, finish, request_id, payload| + req = payload[:request] + + if [:throttle, :blocklist].include? req.env['rack.attack.match_type'] rack_attack_info = { message: 'Rack_Attack', env: req.env['rack.attack.match_type'], |