Skip to content

Commit

Permalink
Bypass cache by default in Zotero.Utilities.Internal.saveURI()
Browse files Browse the repository at this point in the history
  • Loading branch information
dstillman committed Sep 8, 2017
1 parent 5248b08 commit d271683
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 1 addition & 3 deletions chrome/content/zotero/xpcom/attachments.js
Expand Up @@ -317,7 +317,6 @@ Zotero.Attachments = new function(){
const nsIWBP = Components.interfaces.nsIWebBrowserPersist;
var wbp = Components.classes["@mozilla.org/embedding/browser/nsWebBrowserPersist;1"]
.createInstance(nsIWBP);
wbp.persistFlags = nsIWBP.PERSIST_FLAGS_AUTODETECT_APPLY_CONVERSION;
if(cookieSandbox) cookieSandbox.attachToInterfaceRequestor(wbp);
var encodingFlags = false;

Expand Down Expand Up @@ -609,8 +608,7 @@ Zotero.Attachments = new function(){
const nsIWBP = Components.interfaces.nsIWebBrowserPersist;
var wbp = Components.classes["@mozilla.org/embedding/browser/nsWebBrowserPersist;1"]
.createInstance(nsIWBP);
wbp.persistFlags = nsIWBP.PERSIST_FLAGS_AUTODETECT_APPLY_CONVERSION
| nsIWBP.PERSIST_FLAGS_FROM_CACHE;
wbp.persistFlags = nsIWBP.PERSIST_FLAGS_FROM_CACHE;
var ioService = Components.classes["@mozilla.org/network/io-service;1"]
.getService(Components.interfaces.nsIIOService);
var nsIURL = ioService.newURI(url, null, null);
Expand Down
6 changes: 5 additions & 1 deletion chrome/content/zotero/xpcom/utilities_internal.js
Expand Up @@ -405,7 +405,11 @@ Zotero.Utilities.Internal = {
*/
saveURI: function (wbp, uri, target, headers) {
// Handle gzip encoding
wbp.persistFlags |= Ci.nsIWebBrowserPersist.PERSIST_FLAGS_AUTODETECT_APPLY_CONVERSION;
wbp.persistFlags |= wbp.PERSIST_FLAGS_AUTODETECT_APPLY_CONVERSION;
// If not explicitly using cache, skip it
if (!(wbp.persistFlags & wbp.PERSIST_FLAGS_FROM_CACHE)) {
wbp.persistFlags |= wbp.PERSIST_FLAGS_BYPASS_CACHE;
}

if (typeof uri == 'string') {
uri = Services.io.newURI(uri, null, null);
Expand Down

0 comments on commit d271683

Please sign in to comment.