tough-cookie 4.1.2 → 4.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/lib/memstore.js +8 -8
- package/lib/version.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -406,7 +406,7 @@ Retrieve a cookie with the given domain, path, and key (name). The RFC maintains
|
|
|
406
406
|
|
|
407
407
|
Callback takes an error and the resulting `Cookie` object. If no cookie is found then `null` MUST be passed instead (that is, not an error).
|
|
408
408
|
|
|
409
|
-
#### `store.findCookies(domain, path, callback(err, cookies))`
|
|
409
|
+
#### `store.findCookies(domain, path, allowSpecialUseDomain, callback(err, cookies))`
|
|
410
410
|
|
|
411
411
|
Locates cookies matching the given domain and path. This is most often called in the context of [`cookiejar.getCookies()`](#getcookiescurrenturl-options-callbackerr-cookies).
|
|
412
412
|
|
package/lib/memstore.js
CHANGED
|
@@ -39,7 +39,7 @@ class MemoryCookieStore extends Store {
|
|
|
39
39
|
constructor() {
|
|
40
40
|
super();
|
|
41
41
|
this.synchronous = true;
|
|
42
|
-
this.idx =
|
|
42
|
+
this.idx = Object.create(null);
|
|
43
43
|
const customInspectSymbol = getCustomInspectSymbol();
|
|
44
44
|
if (customInspectSymbol) {
|
|
45
45
|
this[customInspectSymbol] = this.inspect;
|
|
@@ -111,10 +111,10 @@ class MemoryCookieStore extends Store {
|
|
|
111
111
|
|
|
112
112
|
putCookie(cookie, cb) {
|
|
113
113
|
if (!this.idx[cookie.domain]) {
|
|
114
|
-
this.idx[cookie.domain] =
|
|
114
|
+
this.idx[cookie.domain] = Object.create(null);
|
|
115
115
|
}
|
|
116
116
|
if (!this.idx[cookie.domain][cookie.path]) {
|
|
117
|
-
this.idx[cookie.domain][cookie.path] =
|
|
117
|
+
this.idx[cookie.domain][cookie.path] = Object.create(null);
|
|
118
118
|
}
|
|
119
119
|
this.idx[cookie.domain][cookie.path][cookie.key] = cookie;
|
|
120
120
|
cb(null);
|
|
@@ -146,7 +146,7 @@ class MemoryCookieStore extends Store {
|
|
|
146
146
|
return cb(null);
|
|
147
147
|
}
|
|
148
148
|
removeAllCookies(cb) {
|
|
149
|
-
this.idx =
|
|
149
|
+
this.idx = Object.create(null);
|
|
150
150
|
return cb(null);
|
|
151
151
|
}
|
|
152
152
|
getAllCookies(cb) {
|
|
@@ -196,9 +196,9 @@ exports.MemoryCookieStore = MemoryCookieStore;
|
|
|
196
196
|
function inspectFallback(val) {
|
|
197
197
|
const domains = Object.keys(val);
|
|
198
198
|
if (domains.length === 0) {
|
|
199
|
-
return "{}";
|
|
199
|
+
return "[Object: null prototype] {}";
|
|
200
200
|
}
|
|
201
|
-
let result = "{\n";
|
|
201
|
+
let result = "[Object: null prototype] {\n";
|
|
202
202
|
Object.keys(val).forEach((domain, i) => {
|
|
203
203
|
result += formatDomain(domain, val[domain]);
|
|
204
204
|
if (i < domains.length - 1) {
|
|
@@ -212,7 +212,7 @@ function inspectFallback(val) {
|
|
|
212
212
|
|
|
213
213
|
function formatDomain(domainName, domainValue) {
|
|
214
214
|
const indent = " ";
|
|
215
|
-
let result = `${indent}'${domainName}': {\n`;
|
|
215
|
+
let result = `${indent}'${domainName}': [Object: null prototype] {\n`;
|
|
216
216
|
Object.keys(domainValue).forEach((path, i, paths) => {
|
|
217
217
|
result += formatPath(path, domainValue[path]);
|
|
218
218
|
if (i < paths.length - 1) {
|
|
@@ -226,7 +226,7 @@ function formatDomain(domainName, domainValue) {
|
|
|
226
226
|
|
|
227
227
|
function formatPath(pathName, pathValue) {
|
|
228
228
|
const indent = " ";
|
|
229
|
-
let result = `${indent}'${pathName}': {\n`;
|
|
229
|
+
let result = `${indent}'${pathName}': [Object: null prototype] {\n`;
|
|
230
230
|
Object.keys(pathValue).forEach((cookieName, i, cookieNames) => {
|
|
231
231
|
const cookie = pathValue[cookieName];
|
|
232
232
|
result += ` ${cookieName}: ${cookie.inspect()}`;
|
package/lib/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// generated by genversion
|
|
2
|
-
module.exports = '4.1.
|
|
2
|
+
module.exports = '4.1.3'
|