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

Configuration option for persistent cookies #80

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
"CrossrefREST.email": "" // Pass an email to Crossref REST API to utilize the faster servers pool
},
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:61.0) Gecko/20100101 Firefox/61.0",
"translatorsDirectory": "./modules/translators"
"translatorsDirectory": "./modules/translators",
"persistentCookies": false // Remember upstream cookies between translation operations. Do not enable for a public service.
}
4 changes: 4 additions & 0 deletions src/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ Zotero.HTTP = new function() {
maxResponseSize: 50 * 1024 * 1024
}, options);

if (config.get('persistentCookies')) {
options.cookieSandbox = true;
}

options.headers = Object.assign({
'User-Agent': config.get('userAgent')
}, options.headers);
Expand Down