File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -1491,6 +1491,6 @@ func isFQDN(fl FieldLevel) bool {
14911491 val = val [0 : len (val )- 1 ]
14921492 }
14931493
1494- return hostnameRegex . MatchString (val ) &&
1495- ( strings . IndexAny (val , "." ) > - 1 )
1494+ return ( strings . IndexAny (val , "." ) > - 1 ) &&
1495+ hostnameRegex . MatchString (val )
14961496}
Original file line number Diff line number Diff line change @@ -796,7 +796,7 @@ Note: See Go's ParseMAC for accepted formats and types:
796796
797797Hostname
798798
799- This validates that a stringa value is a valid Hostname
799+ This validates that a string value is a valid Hostname
800800
801801 Usage: hostname
802802
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ const (
3030 latitudeRegexString = "^[-+]?([1-8]?\\ d(\\ .\\ d+)?|90(\\ .0+)?)$"
3131 longitudeRegexString = "^[-+]?(180(\\ .0+)?|((1[0-7]\\ d)|([1-9]?\\ d))(\\ .\\ d+)?)$"
3232 sSNRegexString = `^\d{3}[- ]?\d{2}[- ]?\d{4}$`
33- hostnameRegexString = `^(( [a-zA-Z]| [a-zA-Z][a-zA- Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9]) $`
33+ hostnameRegexString = `^[a-zA-Z][a-zA-Z0-9\-\.]+[a-z-Az0-9] $`
3434)
3535
3636var (
You can’t perform that action at this time.
0 commit comments