From 978ddb9ebc84e7f7ffce64585b2615466bf18803 Mon Sep 17 00:00:00 2001 From: Ryan Mwangi Date: Mon, 4 Nov 2024 13:46:44 +0300 Subject: [PATCH] Check if calendar URL is a file path or a URL --- server.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server.js b/server.js index 76603b0..bdb58db 100644 --- a/server.js +++ b/server.js @@ -43,8 +43,10 @@ app.post('/merge', async (req, res) => { const sanitizedLinkGroupName = sanitizeFilename(linkGroupName); const filename = `${sanitizedLinkGroupName}.ics`; - // Fetch calendar data from URLs + // Fetch calendar data from URLs or load from local files const promises = calendars.map((calendar) => { + // Check if calendar URL is a file path or a URL + const isFilePath = !calendar.url.startsWith('http'); return axios.get(calendar.url) .then((response) => { return {