Merge pull request #579 from kyoshidajp/replace_git.io

Replace git.io URL
This commit is contained in:
Gonzalo 2022-05-01 16:20:27 -03:00 committed by GitHub
commit 95ce9fdd7c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -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

View file

@ -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