From d594036f66f5691a17cb3d7d7b8073ba37ae43d9 Mon Sep 17 00:00:00 2001 From: lifegpc Date: Sun, 2 Jun 2024 13:42:00 +0800 Subject: [PATCH] Fix --- routes/api/file/[id].ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/routes/api/file/[id].ts b/routes/api/file/[id].ts index 4a9715c..a3edde7 100644 --- a/routes/api/file/[id].ts +++ b/routes/api/file/[id].ts @@ -81,7 +81,9 @@ export const handler: Handlers = { if (m.cfg.use_path_based_img_url) { const ext = extname(f.path); return Response.redirect( - `${get_host(req)}/file/${tverify}/${f.id}${ext}`, + `${get_host(req)}/file/${ + encodeURIComponent(tverify) + }/${f.id}${ext}`, ); } const b = new URLSearchParams();