Merge branch 'master' after user-agent change into email-density
This commit is contained in:
13
app/helpers/fetchWrapper.js
Normal file
13
app/helpers/fetchWrapper.js
Normal 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;
|
||||
Reference in New Issue
Block a user