Launch Week Day 3: Introducing Organization Notifications in Socket.Learn More
Socket
Book a DemoSign in
Socket

tough-cookie

Package Overview
Dependencies
Maintainers
1
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tough-cookie - npm Package Compare versions

Comparing version
0.9.8
to
0.9.9
.npmignore

Sorry, the diff of this file is not supported yet

+1
-1

@@ -344,3 +344,3 @@ /*

*/
var cookie_avs = unparsed.split(/\s*;\s+/);
var cookie_avs = unparsed.split(/\s*;\s*/);
while (cookie_avs.length) {

@@ -347,0 +347,0 @@ var av = cookie_avs.shift();

@@ -6,3 +6,3 @@ {

"keywords": "HTTP cookie cookies set-cookie cookiejar jar RFC6265 RFC2965",
"version": "0.9.8",
"version": "0.9.9",
"homepage": "https://github.com/goinstant/node-cookie",

@@ -9,0 +9,0 @@ "repository": {

+19
-1

@@ -247,3 +247,3 @@ /*

assert.equal(c.TTL(now), 9000);
assert.equal(c.expiryTime(), c.expires);
assert.equal(c.expiryTime(), c.expires.getTime());
},

@@ -453,2 +453,20 @@ "TTL with old expires": function() {

},
},
"Ironically, Google 'GAPS' cookie has very little whitespace": {
topic: function() {
return Cookie.parse("GAPS=1:A1aaaaAaAAa1aaAaAaaAAAaaa1a11a:aaaAaAaAa-aaaA1-;Path=/;Expires=Thu, 17-Apr-2014 02:12:29 GMT;Secure;HttpOnly");
},
"parsed": function(c) { assert.ok(c) },
"key": function(c) { assert.equal(c.key, 'GAPS') },
"value": function(c) { assert.equal(c.value, '1:A1aaaaAaAAa1aaAaAaaAAAaaa1a11a:aaaAaAaAa-aaaA1-') },
"path": function(c) {
assert.notEqual(c.path, '/;Expires'); // BUG
assert.equal(c.path, '/');
},
"expires": function(c) {
assert.notEqual(c.expires, Infinity);
assert.equal(c.expires.getTime(), 1397700749000);
},
"secure": function(c) { assert.ok(c.secure) },
"httponly": function(c) { assert.ok(c.httpOnly) },
}

@@ -455,0 +473,0 @@ }

node_modules/
.*.sw[nmop]
npm-debug.log
diff --git a/lib/cookie.js b/lib/cookie.js
index 07cbeeb..af041c0 100644
--- a/lib/cookie.js
+++ b/lib/cookie.js
@@ -709,11 +709,15 @@ CookieJar.prototype.setCookie = function setCookie(cookie, url, options, cb) {
if (this.rejectPublicSuffixes && cookie.domain) {
var suffix = pubsuffix.getPublicSuffix(cookie.cdomain());
if (suffix == null) // e.g. "com"
- return cb(new Error("Cookie has domain set to a public suffix"));
+ if (cookie.cdomain() == host)
+ cookie.domain = null;
+ else
+ return cb(new Error("Cookie has domain set to a public suffix"));
}
// S5.3 step 6:
if (cookie.domain) {
+ console.log("CMP",host,cookie.cdomain());
if (!domainMatch(host, cookie.cdomain(), false))
return cb(new Error("Cookie not in this host's domain"));
else