fix: align admin behavior and Kratos integrations
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"net"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestPrivateIP(t *testing.T) {
|
||||
for _, value := range []string{"127.0.0.1", "10.0.0.1", "172.16.0.1", "192.168.1.1", "169.254.1.1", "::1"} {
|
||||
if !privateIP(net.ParseIP(value)) {
|
||||
t.Fatalf("expected %s to be private", value)
|
||||
}
|
||||
}
|
||||
if privateIP(net.ParseIP("8.8.8.8")) {
|
||||
t.Fatal("public IP was classified as private")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user