tough-cookie
Advanced tools
Comparing version 0.9.9 to 0.9.11
@@ -58,3 +58,3 @@ /* | ||
w.write("module.exports.getPublicSuffix = ") | ||
w.write("module.exports.getPublicSuffix = "); | ||
w.write(getPublicSuffix.toString()); | ||
@@ -74,3 +74,3 @@ w.write(";\n\n"); | ||
function addToIndex(index,line) { | ||
var prefix = '' | ||
var prefix = ''; | ||
if (line.replace(/^(!|\*\.)/)) { | ||
@@ -116,3 +116,3 @@ prefix = RegExp.$1; | ||
var suffix = '' | ||
var suffix = ''; | ||
var suffixLen = 0; | ||
@@ -148,3 +148,4 @@ for (var i=0; i<parts.length; i++) { | ||
function checkPublicSuffix(give,get) { | ||
assert.equal(getPublicSuffix(give), get, give+' should be '+(get==null?'NULL':get)); | ||
var got = getPublicSuffix(give); | ||
assert.equal(got, get, give+' should be '+(get==null?'NULL':get)+' but got '+got); | ||
} | ||
@@ -176,5 +177,5 @@ | ||
checkPublicSuffix('local', null); | ||
checkPublicSuffix('example.local', 'example.local'); | ||
checkPublicSuffix('b.example.local', 'example.local'); | ||
checkPublicSuffix('a.b.example.local', 'example.local'); | ||
checkPublicSuffix('example.local', null); | ||
checkPublicSuffix('b.example.local', null); | ||
checkPublicSuffix('a.b.example.local', null); | ||
// TLD with only 1 rule. | ||
@@ -181,0 +182,0 @@ checkPublicSuffix('biz', null); |
@@ -209,3 +209,3 @@ /* | ||
// convert to IDN if any non-ASCII characters | ||
if (punycode && /[\u0080-]/) | ||
if (punycode && /[^\u0001-\u007f]/.test(str)) | ||
str = punycode.toASCII(str); | ||
@@ -934,2 +934,3 @@ | ||
permutePath: permutePath, | ||
canonicalDomain: canonicalDomain, | ||
}; |
@@ -6,3 +6,3 @@ { | ||
"keywords": "HTTP cookie cookies set-cookie cookiejar jar RFC6265 RFC2965", | ||
"version": "0.9.9", | ||
"version": "0.9.11", | ||
"homepage": "https://github.com/goinstant/node-cookie", | ||
@@ -9,0 +9,0 @@ "repository": { |
@@ -494,2 +494,7 @@ /* | ||
}, | ||
"IDN": function() { | ||
var c = new Cookie(); | ||
c.domain = "δοκιμή.δοκιμή"; // "test.test" in greek | ||
assert.equal(c.canonicalizedDomain(), "xn--jxalpdlp.xn--jxalpdlp"); | ||
} | ||
} | ||
@@ -496,0 +501,0 @@ }).addBatch({ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
255423
2613