Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync of constructor options for serialization #204

Merged
merged 2 commits into from Oct 20, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
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
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