| Index: lib/url.js |
| diff --git a/lib/url.js b/lib/url.js |
| index 78a5f9599d4dd1404cdebda930e23539a97ad336..b507b950916b8b0c1e01c288154888c1d6cdc718 100644 |
| --- a/lib/url.js |
| +++ b/lib/url.js |
| @@ -92,7 +92,14 @@ function isDomain(hostname) |
| return hostname.indexOf(":") == -1; |
| } |
| -function getBaseDomain(hostname) |
| +let getBaseDomain = |
| +/** |
| + * Returns the base domain for the given hostname. |
| + * |
| + * @param {string} hostname |
| + * @return {string} base domain |
| + */ |
| +exports.getBaseDomain = function(hostname) |
| { |
| let bits = hostname.split("."); |
| let cutoff = bits.length - 2; |
| @@ -112,7 +119,7 @@ function getBaseDomain(hostname) |
| return hostname; |
| return bits.slice(cutoff).join("."); |
| -} |
| +}; |
| /** |
| * Checks whether the request's origin is different from the document's origin. |