1
0
Fork 0
mirror of https://github.com/Luzifer/share.git synced 2024-10-18 13:24:23 +00:00
share/vendor/github.com/aws/aws-sdk-go/private/protocol/host.go
Knut Ahlers 83c43a467c
Deps: Update vendored packages
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2018-10-11 20:17:46 +02:00

21 lines
407 B
Go

package protocol
// ValidHostLabel returns if the label is a valid RFC 1123 Section 2.1 domain
// host label name.
func ValidHostLabel(label string) bool {
if l := len(label); l == 0 || l > 63 {
return false
}
for _, r := range label {
switch {
case r >= '0' && r <= '9':
case r >= 'A' && r <= 'Z':
case r >= 'a' && r <= 'z':
case r == '-':
default:
return false
}
}
return true
}