From 5ae97c6a28122f3fb309adcd8428274d9b2bd795 Mon Sep 17 00:00:00 2001 From: medelibero-sfdc <45400267+medelibero-sfdc@users.noreply.github.com> Date: Tue, 20 Oct 2020 15:56:51 -0700 Subject: [PATCH] Added the rest of the constructor options into the serialized / deserialize functions (#204) Co-authored-by: Andrew Waterman --- CHANGELOG.md | 1 + lib/cookie.js | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d530157a..284a8bc7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ All notable changes to this project will be documented in this file. ### Minor Changes - Added loose mode to the serialized options. Now a serialized cookie jar with loose mode enabled will honor that flag when deserialized. +- Added allowSpecialUseDomain and prefixSecurity to the serialized options. Now any options accepted passed in to the cookie jar will be honored when serialized and deserialized. ## 4.0.0 diff --git a/lib/cookie.js b/lib/cookie.js index dec8b066..ce5ab425 100644 --- a/lib/cookie.js +++ b/lib/cookie.js @@ -1448,6 +1448,8 @@ class CookieJar { // CookieJar configuration: rejectPublicSuffixes: !!this.rejectPublicSuffixes, enableLooseMode: !!this.enableLooseMode, + allowSpecialUseDomain: !!this.allowSpecialUseDomain, + prefixSecurity: getNormalizedPrefixSecurity(this.prefixSecurity), // this gets filled from getAllCookies: cookies: [] @@ -1618,7 +1620,9 @@ class CookieJar { const jar = new CookieJar(store, { rejectPublicSuffixes: serialized.rejectPublicSuffixes, - looseMode: serialized.enableLooseMode + looseMode: serialized.enableLooseMode, + allowSpecialUseDomain: serialized.allowSpecialUseDomain, + prefixSecurity: serialized.prefixSecurity }); jar._importCookies(serialized, err => { if (err) {