Merge branch 'master' after user-agent change into email-density

This commit is contained in:
Naida Vatric
2020-02-21 14:26:33 +01:00
10 changed files with 35 additions and 20 deletions

View File

@@ -0,0 +1,13 @@
const nodeFetch = require("node-fetch");
const { USER_AGENT } = require("../config/appConfig");
const fetch = async (url, options = {}) => {
const newOptions = Object.assign({}, options);
if (!newOptions["headers"]) {
newOptions["headers"] = {};
}
newOptions["headers"]["User-Agent"] = USER_AGENT;
return nodeFetch(url, newOptions);
};
module.exports = fetch;