diff --git a/lib/utils/request-wrapper.js b/lib/utils/request-wrapper.js index 88e48dc6af..5245a5c3b7 100644 --- a/lib/utils/request-wrapper.js +++ b/lib/utils/request-wrapper.js @@ -100,11 +100,15 @@ const requestWrapper = (url, options) => { options.headers.server = 'RSSHub'; try { + const urlHandler = new URL(url); // referer if (!options.headers.referer && !options.headers.Referer) { - const urlHandler = new URL(url); options.headers.referer = urlHandler.origin; } + // host + if (!options.headers.host && !options.headers.Host) { + options.headers.host = urlHandler.host; + } } catch (e) { // do nothing }