From 2454e0c8cf1bd04ceab49c6a7c98f287e2cf4599 Mon Sep 17 00:00:00 2001 From: lifegpc Date: Sun, 2 Jun 2024 13:59:45 +0800 Subject: [PATCH] Fix --- routes/api/file/random.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/routes/api/file/random.ts b/routes/api/file/random.ts index a560e67..5ec518f 100644 --- a/routes/api/file/random.ts +++ b/routes/api/file/random.ts @@ -120,9 +120,15 @@ export const handler: Handlers = { ), ), ); - const b = new URLSearchParams(); - b.append("verify", verify); - url = `${get_host(req)}/file/${f.id}?${b}`; + if (m.cfg.use_path_based_img_url) { + url = `${get_host(req)}/file/${ + encodeURIComponent(verify) + }/${f.id}`; + } else { + const b = new URLSearchParams(); + b.append("verify", verify); + url = `${get_host(req)}/file/${f.id}?${b}`; + } } else { const t = thumb ? "thumbnail" : "file"; if (m.cfg.random_file_secret) {