Skip to content

Commit

Permalink
decode archive url
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidRobertAnsart committed Aug 19, 2023
1 parent c060751 commit 490f3b1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/controllers/archive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 490f3b1

Please sign in to comment.