From 7463abadce5fee6b204a29d55871987f59e9da5e Mon Sep 17 00:00:00 2001 From: younglim Date: Wed, 3 Jan 2024 14:44:49 +0800 Subject: [PATCH] Set Host header when sending URL check request through axios --- constants/common.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/constants/common.js b/constants/common.js index 31331dd9..2e56302e 100644 --- a/constants/common.js +++ b/constants/common.js @@ -262,7 +262,10 @@ const requestToUrl = async (url, isNewCustomFlow) => { const res = {}; await axios .get(url, { - headers: { 'User-Agent': devices['Desktop Chrome HiDPI'].userAgent }, + headers: { + 'User-Agent': devices['Desktop Chrome HiDPI'].userAgent, + 'Host': new URL(url).host + }, httpsAgent, timeout: 2000, })