mirror of
https://github.com/roytam1/UXP.git
synced 2026-05-26 14:54:25 +00:00
Issue #1909 - Ensure UpdateChecker and UpdateParser can handle empty manifest URLs.
This commit is contained in:
@@ -611,6 +611,14 @@ function UpdateParser(aId, aUpdateKey, aUrl, aObserver) {
|
||||
let requireBuiltIn = Services.prefs.getBoolPref(PREF_UPDATE_REQUIREBUILTINCERTS, true);
|
||||
|
||||
logger.debug("Requesting " + aUrl);
|
||||
|
||||
if (!aUrl) {
|
||||
logger.warn("Request failed: empty update manifest URL");
|
||||
this._doneAt = new Error("UP_emptyManifestURL");
|
||||
this.notifyError(AddonUpdateChecker.ERROR_DOWNLOAD_ERROR);
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
this.request = new ServiceRequest();
|
||||
this.request.open("GET", this.url, true);
|
||||
|
||||
@@ -6134,6 +6134,15 @@ function UpdateChecker(aAddon, aListener, aReason, aAppVersion, aPlatformVersion
|
||||
aReason |= UPDATE_TYPE_COMPATIBILITY;
|
||||
if ("onUpdateAvailable" in this.listener)
|
||||
aReason |= UPDATE_TYPE_NEWVERSION;
|
||||
|
||||
// Pass an empty string as the url and call checkForUpdates now if
|
||||
// updateURL is empty. UpdateParser should detect this and fail early.
|
||||
|
||||
if (!updateURL) {
|
||||
this._parser = AddonUpdateChecker.checkForUpdates(aAddon.id, aAddon.updateKey,
|
||||
"", this);
|
||||
return;
|
||||
}
|
||||
|
||||
let url = escapeAddonURI(aAddon, updateURL, aReason, aAppVersion);
|
||||
this._parser = AddonUpdateChecker.checkForUpdates(aAddon.id, aAddon.updateKey,
|
||||
|
||||
Reference in New Issue
Block a user