~cytrogen/masto-fe

ref: 4ea24537cf9c1fafd0edf79acd8cf666be662fbe masto-fe/config/initializers/rack_attack_logging.rb -rw-r--r-- 343 bytes
4ea24537 — dependabot[bot] Bump rubocop-performance from 1.17.1 to 1.18.0 (#25089) 2 years ago
                                                                                
1
2
3
4
5
6
7
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