diff --git a/lib/parameters.js b/lib/parameters.js index e0751fd..0eb30b2 100644 --- a/lib/parameters.js +++ b/lib/parameters.js @@ -32,17 +32,14 @@ function findOptionalArgs(opts, find) { } function getFetchOptions(isCrawler) { - const fetchOptions = {}; - const headers = { - 'accept': 'text/html', + const fetchOptions = { + headers: { + 'accept': 'text/html', + }, }; if (typeof isCrawler === 'boolean' && isCrawler) { - headers['user-agent'] = CRAWLER_USER_AGENT; - } - - if (Object.keys(headers).length !== 0) { - fetchOptions.headers = headers; + fetchOptions.headers['user-agent'] = CRAWLER_USER_AGENT; } return fetchOptions;