Fix error when trying to register (#17600)
This commit is contained in:
		
							parent
							
								
									823d816c06
								
							
						
					
					
						commit
						9f9e82918f
					
				
					 1 changed files with 4 additions and 5 deletions
				
			
		| 
						 | 
					@ -83,11 +83,10 @@ class Rack::Attack
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  throttle('throttle_sign_up_attempts/ip', limit: 25, period: 5.minutes) do |req|
 | 
					  throttle('throttle_sign_up_attempts/ip', limit: 25, period: 5.minutes) do |req|
 | 
				
			||||||
    if req.post? && req.path == '/auth'
 | 
					    if req.post? && req.path == '/auth'
 | 
				
			||||||
      if req.remote_ip.ipv6?
 | 
					      addr = req.remote_ip
 | 
				
			||||||
        req.remote_ip.mask(64)
 | 
					      addr = IPAddr.new(addr) if addr.is_a?(String)
 | 
				
			||||||
      else
 | 
					      addr = addr.mask(64) if addr.ipv6?
 | 
				
			||||||
        req.remote_ip
 | 
					      addr.to_s
 | 
				
			||||||
      end
 | 
					 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue