Sha256: 59c0eb8e0f2950f371f80b6e9c93c1b354859d9466864010ea41a1e49cdaaaec
Contents?: true
Size: 512 Bytes
Versions: 38
Compression:
Stored size: 512 Bytes
Contents
# frozen_string_literal: true if Rails.env.production? || Rails.env.test? require "rack/attack" # Throttle check census attempts by IP to 6 reqs/minute # Return the IP as a discriminator on POST /check_census requests Rack::Attack.throttle( "limit check census data attempts per request by IP", limit: Decidim::Votings.check_census_max_requests, period: Decidim::Votings.throttling_period ) do |request| request.ip if request.path.include?("/check_census") && request.post? end end
Version data entries
38 entries across 38 versions & 1 rubygems