Skip to content

Commit

Permalink
Expose getPublicSuffix()
Browse files Browse the repository at this point in the history
  • Loading branch information
stash committed Oct 31, 2011
1 parent 2a6b33c commit 2f1e409
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,15 @@ fromJSON(string)

alias for `Cookie.fromJSON(string)`

getPublicSuffix(hostname)
-------------------------

Returns the public suffix of this hostname. The public suffix is the shortest domain-name upon which a cookie can be set. Returns `null` if the hostname cannot have cookies set for it.

For example: `www.example.com` and `www.subdomain.example.com` both have public suffix `example.com`.

For further information, see http://publicsuffix.org/. This module derives its list from that site.

Cookie
======

Expand Down
1 change: 1 addition & 0 deletions lib/cookie.js
Original file line number Diff line number Diff line change
Expand Up @@ -794,4 +794,5 @@ module.exports = {
domainMatch: domainMatch,
defaultPath: defaultPath,
pathMatch: pathMatch,
getPublicSuffix: pubsuffix.getPublicSuffix,
};

0 comments on commit 2f1e409

Please sign in to comment.