diff --git a/lib/helpers/request.js b/lib/helpers/request.js index 8311c55ed..c4927d203 100644 --- a/lib/helpers/request.js +++ b/lib/helpers/request.js @@ -13,8 +13,12 @@ const cacheable = new CacheableLookup({ }); module.exports = async function request(options) { + Object.assign(options, { + url: new URL(options.url), + headers: options.headers || {}, + }); // eslint-disable-next-line no-param-reassign - options.url = new URL(options.url); + options.headers['user-agent'] = undefined; const { timeout, agent, lookup } = instance(this).configuration('httpOptions')(new URL(options.url)); const helperOptions = omitBy({ timeout, agent, lookup }, Boolean);