Sha256: b55beaabd21ec9b393e86ee03c9cf3333d4ff9fbd051af53503b6fcefc616841

Contents?: true

Size: 296 Bytes

Versions: 3

Compression:

Stored size: 296 Bytes

Contents

class Rack::Attack
  # Throttle POST requests to /shares by IP Address
  #
  # Key: "rack::attack:#{Time.now.to_i/:period}:shares/ip:#{req.ip}"
  throttle('shares/ip', limit: 6, period: 60.seconds) do |request|
    if request.path == '/shares' && request.post?
      request.ip
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
workarea-share-1.3.1 config/initializers/rack_attack.rb
workarea-share-1.3.0 config/initializers/rack_attack.rb
workarea-share-1.2.4 config/initializers/rack_attack.rb