Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/downloader.js

Issue 29801558: Issue 6737 - Use String.includes instead of String.indexOf (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Replace more instances Created June 7, 2018, 9:51 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/common.js ('k') | lib/filterClasses.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/downloader.js
===================================================================
--- a/lib/downloader.js
+++ b/lib/downloader.js
@@ -202,17 +202,17 @@
* @param {Downloadable} downloadable
* @return {string}
*/
getDownloadUrl(downloadable)
{
const {addonName, addonVersion, application, applicationVersion,
platform, platformVersion} = require("info");
let url = downloadable.redirectURL || downloadable.url;
- if (url.indexOf("?") >= 0)
+ if (url.includes("?"))
url += "&";
else
url += "?";
// We limit the download count to 4+ to keep the request anonymized
let {downloadCount} = downloadable;
if (downloadCount > 4)
downloadCount = "4+";
url += "addonName=" + encodeURIComponent(addonName) +
« no previous file with comments | « lib/common.js ('k') | lib/filterClasses.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld