Skip to content

Commit

Permalink
Fix #184
Browse files Browse the repository at this point in the history
  • Loading branch information
asaskevich committed Apr 25, 2017
1 parent 700b7e7 commit 4918b99
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion validator.go
Expand Up @@ -461,7 +461,7 @@ func IsDNSName(str string) bool {
// constraints already violated
return false
}
return rxDNSName.MatchString(str)
return !IsIP(str) && rxDNSName.MatchString(str)
}

// IsDialString validates the given string for usage with the various Dial() functions
Expand Down
1 change: 1 addition & 0 deletions validator_test.go
Expand Up @@ -1512,6 +1512,7 @@ func TestIsDNSName(t *testing.T) {
{"localhost.localdomain.üntern", false},
{"127.0.0.1", false},
{"[::1]", false},
{"50.50.50.50", false},
{"localhost.localdomain.intern:65535", false},
{"漢字汉字", false},
{"www.jubfvq1v3p38i51622y0dvmdk1mymowjyeu26gbtw9andgynj1gg8z3msb1kl5z6906k846pj3sulm4kiyk82ln5teqj9nsht59opr0cs5ssltx78lfyvml19lfq1wp4usbl0o36cmiykch1vywbttcus1p9yu0669h8fj4ll7a6bmop505908s1m83q2ec2qr9nbvql2589adma3xsq2o38os2z3dmfh2tth4is4ixyfasasasefqwe4t2ub2fz1rme.de", false},
Expand Down

0 comments on commit 4918b99

Please sign in to comment.