From 1457efa9a4a33af433fa9efed18f12b76555e863 Mon Sep 17 00:00:00 2001 From: Alen Date: Tue, 2 Jul 2024 01:07:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=8B=E8=BD=BD=E5=87=BD?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 为默认Headers增加Host,解决一些网站无法下载文件的问题 --- src/common/utils/file.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/common/utils/file.ts b/src/common/utils/file.ts index 3b7f5c716..d5ccf4a1b 100644 --- a/src/common/utils/file.ts +++ b/src/common/utils/file.ts @@ -148,6 +148,8 @@ export async function httpDownload(options: string | HttpDownloadOptions): Promi }; if (typeof options === 'string') { url = options; + const host = new URL(url).hostname; + headers['Host'] = host; } else { url = options.url; if (options.headers) {