|
package validator
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"golang.org/x/net/publicsuffix"
|
|
)
|
|
|
|
func isCookieDomainAPublicSuffix(domain string) (valid bool) {
|
|
var suffix string
|
|
|
|
suffix, _ = publicsuffix.PublicSuffix(domain)
|
|
|
|
return len(strings.TrimLeft(domain, ".")) == len(suffix)
|
|
}
|