about summary refs log tree commit diff
path: root/config
diff options
context:
space:
mode:
authordependabot[bot] <dependabot[bot]@users.noreply.github.com>2019-05-03 16:16:11 +0200
committerEugen Rochko <eugen@zeonfederated.com>2019-05-03 16:16:11 +0200
commitecbea2e3c6e49387b1eaefbbebd2013867414ca2 (patch)
tree3fe1decf9f5aec28b7c0a678642df203407b4669 /config
parent61e28b0ccc04f7a0c72cb663962eb152ab63a998 (diff)
Bump rack-attack from 5.4.2 to 6.0.0 (#10599)
* Bump rack-attack from 5.4.2 to 6.0.0

Bumps [rack-attack](https://github.com/kickstarter/rack-attack) from 5.4.2 to 6.0.0.
- [Release notes](https://github.com/kickstarter/rack-attack/releases)
- [Changelog](https://github.com/kickstarter/rack-attack/blob/master/CHANGELOG.md)
- [Commits](https://github.com/kickstarter/rack-attack/compare/v5.4.2...v6.0.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* fix payload[:request]
Diffstat (limited to 'config')
-rw-r--r--config/initializers/rack_attack_logging.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/config/initializers/rack_attack_logging.rb b/config/initializers/rack_attack_logging.rb
index 2ddbfb99c..c30bd8a64 100644
--- a/config/initializers/rack_attack_logging.rb
+++ b/config/initializers/rack_attack_logging.rb
@@ -1,4 +1,6 @@
-ActiveSupport::Notifications.subscribe('rack.attack') do |_name, _start, _finish, _request_id, req|
+ActiveSupport::Notifications.subscribe(/rack_attack/) do |_name, _start, _finish, _request_id, payload|
+  req = payload[:request]
+
   next unless [:throttle, :blacklist].include? req.env['rack.attack.match_type']
   Rails.logger.info("Rate limit hit (#{req.env['rack.attack.match_type']}): #{req.ip} #{req.request_method} #{req.fullpath}")
 end