publicsuffixlist-0.0.2: Is a given string a domain suffix?

Safe HaskellNone




isSuffix :: Text -> BoolSource

>>> isSuffix = isSuffix' Network.PublicSuffixList.DataStructure.dataStructure

isSuffix' :: DataStructure -> Text -> BoolSource

This function returns whether or not this domain is owned by a registrar or a regular person. True means that this is a registrar domain; False means it's owned by a person. This is used to determine if a cookie is allowed to bet set for a particular domain. For example, you shouldn't be able to set a cookie for "com".

Note that this function expects lowercase ASCII strings. These strings should be gotten from the toASCII algorithm as described in RFC 3490. These strings should not start or end with the '.' character, and should not have two '.' characters next to each other. (The toASCII algorithm is implemented in the 'idna' hackage package, though that package doesn't always map strings to lowercase)