Skip to content

Commit

Permalink
Added the rest of the constructor options into the serialized / deser…
Browse files Browse the repository at this point in the history
…ialize functions (#204)

Co-authored-by: Andrew Waterman <awaterman@salesforce.com>
  • Loading branch information
medelibero-sfdc and awaterma authored Oct 20, 2020
1 parent 1ac7c43 commit 5ae97c6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 5 additions & 1 deletion lib/cookie.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: []
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 5ae97c6

Please sign in to comment.