This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Please use the package https://github.com/chmike/domain as is it maintained up to date with tests. | |
// checkDomain returns an error if the domain name is not valid. | |
// See https://tools.ietf.org/html/rfc1034#section-3.5 and | |
// https://tools.ietf.org/html/rfc1123#section-2. | |
func checkDomain(name string) error { | |
switch { | |
case len(name) == 0: | |
return nil // an empty domain name will result in a cookie without a domain restriction | |
case len(name) > 255: |