Bug 802016 - Do not allow caching at all when checking for updates. r=rstrong. a=blocking-basecamp

This commit is contained in:
Brian R. Bondy 2012-10-17 13:43:07 -04:00
Родитель 24efdd930e
Коммит febccbad1e
1 изменённых файлов: 11 добавлений и 0 удалений

Просмотреть файл

@ -2730,8 +2730,19 @@ Checker.prototype = {
var allowNonBuiltIn = !getPref("getBoolPref",
PREF_APP_UPDATE_CERT_REQUIREBUILTIN, true);
this._request.channel.notificationCallbacks = new gCertUtils.BadCertHandler(allowNonBuiltIn);
// Prevent the request from reading from the cache.
this._request.channel.loadFlags |= Ci.nsIRequest.LOAD_BYPASS_CACHE;
// Prevent the request from writing to the cache.
this._request.channel.loadFlags |= Ci.nsIRequest.INHIBIT_CACHING;
this._request.overrideMimeType("text/xml");
// The Cache-Control header is only interpreted by proxies and the
// final destination. It does not help if a resource is already
// cached locally.
this._request.setRequestHeader("Cache-Control", "no-cache");
// HTTP/1.0 servers might not implement Cache-Control and
// might only implement Pragma: no-cache
this._request.setRequestHeader("Pragma", "no-cache");
var self = this;
this._request.addEventListener("error", function(event) { self.onError(event); } ,false);