mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-10-15 07:20:26 +00: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