mirror of
https://github.com/samsonjs/rack-attack.git
synced 2026-03-25 09:25:49 +00:00
Replace git.io URL
This commit is contained in:
parent
f5f92f4459
commit
d3be2f31a5
2 changed files with 4 additions and 2 deletions
|
|
@ -62,7 +62,7 @@ module Rack
|
|||
|
||||
def key_and_expiry(unprefixed_key, period)
|
||||
@last_epoch_time = Time.now.to_i
|
||||
# Add 1 to expires_in to avoid timing error: https://git.io/i1PHXA
|
||||
# Add 1 to expires_in to avoid timing error: https://github.com/rack/rack-attack/pull/85
|
||||
expires_in = (period - (@last_epoch_time % period) + 1).to_i
|
||||
["#{prefix}:#{(@last_epoch_time / period).to_i}:#{unprefixed_key}", expires_in]
|
||||
end
|
||||
|
|
|
|||
|
|
@ -4,7 +4,9 @@ module Rack
|
|||
class Attack
|
||||
# When using Rack::Attack with a Rails app, developers expect the request path
|
||||
# to be normalized. In particular, trailing slashes are stripped.
|
||||
# (See https://git.io/v0rrR for implementation.)
|
||||
# (See
|
||||
# https://github.com/rails/rails/blob/f8edd20/actionpack/lib/action_dispatch/journey/router/utils.rb#L5-L22
|
||||
# for implementation.)
|
||||
#
|
||||
# Look for an ActionDispatch utility class that Rails folks would expect
|
||||
# to normalize request paths. If unavailable, use a fallback class that
|
||||
|
|
|
|||
Loading…
Reference in a new issue