From 490f3b1827c0e5f2c6ffc6d28a4346095412ecbc Mon Sep 17 00:00:00 2001 From: David Robert-Ansart Date: Sat, 19 Aug 2023 16:51:49 +0200 Subject: [PATCH] decode archive url --- server/controllers/archive.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/controllers/archive.ts b/server/controllers/archive.ts index da8f874e1..0bdaa1e5f 100644 --- a/server/controllers/archive.ts +++ b/server/controllers/archive.ts @@ -8,7 +8,8 @@ const archiveController = new Controller('/archives'); // get file archiveController.get({ path: '/*', userType: UserType.ADMIN }, async (req: Request, res: Response, next: NextFunction) => { - const key = `archives${req.url}${req.url.split('/').length === 2 ? '/index.html' : req.url.indexOf('.') === -1 ? '.html' : ''}`; + const url = decodeURI(req.url); + const key = `archives${url}${url.split('/').length === 2 ? '/index.html' : url.indexOf('.') === -1 ? '.html' : ''}`; try { streamFile(key, req, res, next); } catch {