mirror of
https://github.com/LLOneBot/LLOneBot.git
synced 2024-11-22 01:56:33 +00:00
fix: download file add referer
This commit is contained in:
@@ -133,7 +133,7 @@ export async function uri2local(uri: string, filename?: string, needExt?: boolea
|
||||
|
||||
if (type === FileUriType.RemoteURL) {
|
||||
try {
|
||||
const res = await fetchFile(uri)
|
||||
const res = await fetchFile(uri, {'Referer': uri})
|
||||
const match = res.url.match(/.+\/([^/?]*)(?=\?)?/)
|
||||
if (match?.[1]) {
|
||||
filename ??= match[1].replace(/[/\\:*?"<>|]/g, '_')
|
||||
|
@@ -1 +1 @@
|
||||
export const version = '3.32.1'
|
||||
export const version = '3.32.2'
|
||||
|
Reference in New Issue
Block a user