Renamed var.

This commit is contained in:
Naida Vatric
2020-02-23 23:11:21 +01:00
parent 148b2ea863
commit ce857ddce9

View File

@@ -11,11 +11,11 @@ const fetch = async (url, options = {}) => {
newOptions["headers"] = {};
}
newOptions["headers"]["User-Agent"] = USER_AGENT;
const newUrl = USE_SCRAPER_API
const urlAdaptedForScraping = USE_SCRAPER_API
? `http://api.scraperapi.com/?api_key=${SCRAPER_API_KEY}&url=${url}`
: url;
return nodeFetch(newUrl, newOptions);
return nodeFetch(urlAdaptedForScraping, newOptions);
};
module.exports = fetch;