mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-03 09:46:24 +01:00
Fix error when trying to register (#17600)
This commit is contained in:
parent
2e89067d21
commit
8603a07504
@ -83,11 +83,10 @@ class Rack::Attack
|
||||
|
||||
throttle('throttle_sign_up_attempts/ip', limit: 25, period: 5.minutes) do |req|
|
||||
if req.post? && req.path == '/auth'
|
||||
if req.remote_ip.ipv6?
|
||||
req.remote_ip.mask(64)
|
||||
else
|
||||
req.remote_ip
|
||||
end
|
||||
addr = req.remote_ip
|
||||
addr = IPAddr.new(addr) if addr.is_a?(String)
|
||||
addr = addr.mask(64) if addr.ipv6?
|
||||
addr.to_s
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user