From e429bbbcdbab18b7c0d1498100860211e4fa387d Mon Sep 17 00:00:00 2001 From: CrescentLeaf Date: Thu, 2 Oct 2025 18:42:29 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=80=8F=E8=A6=BD=E5=99=A8=E4=B8=8B?= =?UTF-8?q?=E8=BC=89=E6=96=87=E4=BB=B6=E6=99=82,=20=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E8=A8=AD=E5=AE=9A=E7=88=B2=E5=8E=9F=E5=A7=8B=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=90=8D=20*=20=E5=9F=BA=E6=96=BC=20Content-Disposition?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/main.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/main.ts b/server/main.ts index 66ceddf..00fe168 100644 --- a/server/main.ts +++ b/server/main.ts @@ -45,6 +45,8 @@ app.get('/uploaded_files/:hash', (req, res) => { } } + const fileName = encodeURIComponent(file!.getName()?.replaceAll('"', '')) + res.setHeader('Content-Disposition', `inline; filename="${fileName}"`) res.setHeader('Content-Type', file!.getMime()) res.sendFile(path.resolve(file!.getFilePath())) })