From b96b74ef70decc215bd33d0d05279d8b27abd1c6 Mon Sep 17 00:00:00 2001 From: Andrew Molchanov Date: Sun, 13 Jun 2021 21:07:46 +0300 Subject: [PATCH] fix --- src/api/WebServerManager.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/WebServerManager.ts b/src/api/WebServerManager.ts index fd9b9291..8350d136 100644 --- a/src/api/WebServerManager.ts +++ b/src/api/WebServerManager.ts @@ -60,14 +60,14 @@ export class WebServerManager { } private requestListener(req: http.IncomingMessage, res: http.ServerResponse): void { - if (req.url.startsWith("/files")) return this.fileListing(req.url, res) // TODO CHECK + if (req.url.startsWith("/files")) return this.fileListing(req.url, res) this.requestsManager.getRequest(req, res) } private fileListing(url: string, res: http.ServerResponse): void { if (url.includes("?")) url = url.split("?")[0] - const filePath = path.join(StorageHelper.updatesDir, url) + const filePath = path.join(StorageHelper.updatesDir, url.slice(6)) if (!fs.existsSync(filePath)) { res.writeHead(404)