mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +00:00
修改下载函数
为默认Headers增加Host,解决一些网站无法下载文件的问题
This commit is contained in:
parent
fa5c7add7a
commit
1457efa9a4
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user