Sha256: d0554b3faa47d6c1d79515a1e4ea265aecaf9c232d2e5ac26f800ee837b6bcba

Contents?: true

Size: 314 Bytes

Versions: 8

Compression:

Stored size: 314 Bytes

Contents

ActiveSupport::Notifications.subscribe "rack.attack" do |_name, _start, _finish, _request_id, req|
  request = req.is_a?(Hash) ? req[:request] : req

  if [:blacklist, :blocklist, :throttle].include?(request.env["rack.attack.match_type"])
    Notable.track "Throttle", request.env["rack.attack.matched"]
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
notable-0.5.2 lib/notable/throttle.rb
notable-0.5.1 lib/notable/throttle.rb
notable-0.5.0 lib/notable/throttle.rb
notable-0.4.1 lib/notable/throttle.rb
notable-0.4.0 lib/notable/throttle.rb
notable-0.3.4 lib/notable/throttle.rb
notable-0.3.3 lib/notable/throttle.rb
notable-0.3.2 lib/notable/throttle.rb