mirror of
				https://github.com/songquanpeng/one-api.git
				synced 2025-11-04 15:53:42 +08:00 
			
		
		
		
	fix: fix IsValidSubnet
This commit is contained in:
		@@ -9,7 +9,10 @@ import (
 | 
			
		||||
 | 
			
		||||
func IsValidSubnet(subnet string) error {
 | 
			
		||||
	_, _, err := net.ParseCIDR(subnet)
 | 
			
		||||
	return fmt.Errorf("failed to parse subnet: %w", err)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return fmt.Errorf("failed to parse subnet: %w", err)
 | 
			
		||||
	}
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func IsIpInSubnet(ctx context.Context, ip string, subnet string) bool {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user