Allow setting a cookie sandbox for Zotero.Utilities.Internal.saveURI()
This isn't used or tested.
This commit is contained in:
parent
6070743ff0
commit
b9d5c33993
1 changed files with 7 additions and 7 deletions
|
@ -433,9 +433,9 @@ Zotero.Utilities.Internal = {
|
|||
* @param {nsIURI} uri URL
|
||||
* @param {nsIFile|string path} target file
|
||||
* @param {Object} [headers]
|
||||
* @param {Boolean} [isPrivate=false] - Treat as private request (e.g., don't send cookies)
|
||||
* @param {Zotero.CookieSandbox} [cookieSandbox]
|
||||
*/
|
||||
saveURI: function (wbp, uri, target, headers, isPrivate = false) {
|
||||
saveURI: function (wbp, uri, target, headers, cookieSandbox) {
|
||||
// Handle gzip encoding
|
||||
wbp.persistFlags |= wbp.PERSIST_FLAGS_AUTODETECT_APPLY_CONVERSION;
|
||||
// If not explicitly using cache, skip it
|
||||
|
@ -453,12 +453,12 @@ Zotero.Utilities.Internal = {
|
|||
headers = Object.keys(headers).map(x => x + ": " + headers[x]).join("\r\n") + "\r\n";
|
||||
}
|
||||
|
||||
if (isPrivate) {
|
||||
wbp.savePrivacyAwareURI(uri, null, null, null, null, headers, target, true);
|
||||
}
|
||||
else {
|
||||
wbp.saveURI(uri, null, null, null, null, headers, target, null);
|
||||
// Untested
|
||||
if (cookieSandbox) {
|
||||
cookieSandbox.attachToInterfaceRequestor(wbp.progressListener);
|
||||
}
|
||||
|
||||
wbp.saveURI(uri, null, null, null, null, headers, target, null);
|
||||
},
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue