publicsuffix-0.20170508: The publicsuffix list exposed as proper Haskell types

Safe HaskellNone
LanguageHaskell2010

Data.PublicSuffix

Synopsis

Documentation

publicSuffix :: String -> String Source #

Return the public suffix of the given domain name (a dot-delimited unicode string). The public suffix is the part of a domain which should be protected.

Notes:

  • The domain MUST NOT start with a dot. Normalize the domain before passing it to functions in this module.
  • The domain MUST NOT be in punycode encoding. The matching of domain labels is done on the original encoding, as specified in the upstream publicsuffix list.

In particular that means applications SHOULD reject:

  • HTTP cookies which try to set domain to a public suffix.
  • X509 wildcard certificates which try to match all subdomains of a public suffix.

registeredDomain :: String -> Maybe String Source #

Return the domain that was registered or is registrable by a user. These domains are fully controlled by users, and applications SHOULD accept cookies and wildcard certificates for those.