From 9420ce1cce0922c92f98301794b8fdd06b1a133f Mon Sep 17 00:00:00 2001 From: Ryan Mwangi Date: Fri, 25 Oct 2024 14:44:43 +0300 Subject: [PATCH] ensure path to the ics file is absolute --- server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server.js b/server.js index a3caefa..dd159fc 100644 --- a/server.js +++ b/server.js @@ -109,7 +109,7 @@ END:VEVENT // Serve the merged calendar file and refresh if older than an hour app.get('/calendar/:name', async (req, res) => { const calendarName = req.params.name; - const icsFilePath = path.join(MERGED_CALENDARS_DIR, `${calendarName}.ics`); + const icsFilePath = path.resolve(MERGED_CALENDARS_DIR, `${calendarName}.ics`); const jsonFilePath = path.join(MERGED_CALENDARS_DIR, `${calendarName}.json`); try {