16 lines
267 B
Go
16 lines
267 B
Go
|
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)
|
||
|
}
|