From 97598b5ab51731fbb94a4795bc3fd668491bb76a Mon Sep 17 00:00:00 2001 From: Michiel Sikma Date: Fri, 3 Sep 2021 15:59:50 +0200 Subject: [PATCH] Add allowSpecialUseDomain support so the callback is properly passed on --- index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 715606e..954b068 100644 --- a/index.js +++ b/index.js @@ -261,9 +261,13 @@ FileCookieStore.prototype.findCookie = function(domain, path, key, cb) { }; -FileCookieStore.prototype.findCookies = function (domain, path, cb) { +FileCookieStore.prototype.findCookies = function (domain, path, allowSpecialUseDomain, cb) { var self = this, results = []; + if (typeof allowSpecialUseDomain === "function") { + cb = allowSpecialUseDomain; + allowSpecialUseDomain = false; + } if (! domain ) return cb(null,[]); var can_domain = canonicalDomain(domain); @@ -312,7 +316,7 @@ FileCookieStore.prototype.findCookies = function (domain, path, cb) { }; } - var domains = permuteDomain(can_domain) || [can_domain]; + var domains = permuteDomain(can_domain, allowSpecialUseDomain) || [can_domain]; var idx = self.idx; domains.forEach(function(curDomain) { var domainIndex = idx[curDomain];