Skip to content

Commit 4918b99

Browse files
committed
Fix #184
1 parent 700b7e7 commit 4918b99

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

validator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ func IsDNSName(str string) bool {
461461
// constraints already violated
462462
return false
463463
}
464-
return rxDNSName.MatchString(str)
464+
return !IsIP(str) && rxDNSName.MatchString(str)
465465
}
466466

467467
// IsDialString validates the given string for usage with the various Dial() functions

validator_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1512,6 +1512,7 @@ func TestIsDNSName(t *testing.T) {
15121512
{"localhost.localdomain.üntern", false},
15131513
{"127.0.0.1", false},
15141514
{"[::1]", false},
1515+
{"50.50.50.50", false},
15151516
{"localhost.localdomain.intern:65535", false},
15161517
{"漢字汉字", false},
15171518
{"www.jubfvq1v3p38i51622y0dvmdk1mymowjyeu26gbtw9andgynj1gg8z3msb1kl5z6906k846pj3sulm4kiyk82ln5teqj9nsht59opr0cs5ssltx78lfyvml19lfq1wp4usbl0o36cmiykch1vywbttcus1p9yu0669h8fj4ll7a6bmop505908s1m83q2ec2qr9nbvql2589adma3xsq2o38os2z3dmfh2tth4is4ixyfasasasefqwe4t2ub2fz1rme.de", false},

0 commit comments

Comments
 (0)