Index: lib/downloader.js |
=================================================================== |
--- a/lib/downloader.js |
+++ b/lib/downloader.js |
@@ -191,13 +191,18 @@ |
url += "&"; |
else |
url += "?"; |
+ // We limit the download count to 4+ to keep the request anonymized |
+ let downloadCount = downloadable.downloadCount; |
+ if (downloadCount > 4) |
+ downloadCount = "4+"; |
url += "addonName=" + encodeURIComponent(addonName) + |
"&addonVersion=" + encodeURIComponent(addonVersion) + |
"&application=" + encodeURIComponent(application) + |
"&applicationVersion=" + encodeURIComponent(applicationVersion) + |
"&platform=" + encodeURIComponent(platform) + |
"&platformVersion=" + encodeURIComponent(platformVersion) + |
- "&lastVersion=" + encodeURIComponent(downloadable.lastVersion); |
+ "&lastVersion=" + encodeURIComponent(downloadable.lastVersion) + |
+ "&downloadCount=" + encodeURIComponent(downloadCount); |
return url; |
}, |
@@ -291,6 +296,8 @@ |
return; |
} |
+ downloadable.downloadCount++; |
+ |
this.onDownloadSuccess(downloadable, request.responseText, errorCallback, function redirectCallback(url) |
{ |
if (redirects >= this.maxRedirects) |
@@ -378,4 +385,10 @@ |
* @type Integer |
*/ |
hardExpiration: 0, |
+ |
+ /** |
+ * Number indicating how often the object was downloaded. |
+ * @type Integer |
+ */ |
+ downloadCount: 0, |
}; |