Bug 827750 - Inhibiting HTTP cache for app updates. r=fabrice

This commit is contained in:
Etienne Segonzac 2013-01-09 02:02:08 -08:00
parent 88feeaf040
commit b02959b0d1

View File

@ -1266,6 +1266,7 @@ this.DOMApplicationRegistry = {
let xhr = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"]
.createInstance(Ci.nsIXMLHttpRequest);
xhr.open("GET", aData.manifestURL, true);
xhr.channel.loadFlags |= Ci.nsIRequest.INHIBIT_CACHING;
xhr.responseType = "json";
if (app.etag) {
xhr.setRequestHeader("If-None-Match", app.etag);
@ -1363,7 +1364,7 @@ this.DOMApplicationRegistry = {
let xhr = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"]
.createInstance(Ci.nsIXMLHttpRequest);
xhr.open("GET", app.manifestURL, true);
xhr.channel.loadFlags |= Ci.nsIRequest.VALIDATE_ALWAYS;
xhr.channel.loadFlags |= Ci.nsIRequest.INHIBIT_CACHING;
xhr.channel.notificationCallbacks = this.createLoadContext(aData.appId,
aData.isBrowser);
xhr.responseType = "json";
@ -1426,7 +1427,7 @@ this.DOMApplicationRegistry = {
let xhr = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"]
.createInstance(Ci.nsIXMLHttpRequest);
xhr.open("GET", app.manifestURL, true);
xhr.channel.loadFlags |= Ci.nsIRequest.VALIDATE_ALWAYS;
xhr.channel.loadFlags |= Ci.nsIRequest.INHIBIT_CACHING;
xhr.channel.notificationCallbacks = this.createLoadContext(aData.appId,
aData.isBrowser);
xhr.responseType = "json";
@ -1777,6 +1778,7 @@ this.DOMApplicationRegistry = {
let requestChannel = NetUtil.newChannel(aManifest.fullPackagePath())
.QueryInterface(Ci.nsIHttpChannel);
requestChannel.loadFlags |= Ci.nsIRequest.INHIBIT_CACHING;
if (app.packageEtag) {
debug('Add If-None-Match header: ' + app.packageEtag);
requestChannel.setRequestHeader("If-None-Match", app.packageEtag, false);