From 0d05da40b0f8d96bd8fc8b88a1aa94c14024bcf5 Mon Sep 17 00:00:00 2001 From: Bobby Wibowo Date: Fri, 19 Aug 2022 09:29:11 +0700 Subject: [PATCH] fix: fallback deletion url to relative path if homeDomain is not configured via config file or env var the deletion url is a frontend page, so it cannot simply assume it's on the same domain as uploaded files --- controllers/uploadController.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/uploadController.js b/controllers/uploadController.js index a6dca59..a51a8dc 100644 --- a/controllers/uploadController.js +++ b/controllers/uploadController.js @@ -1103,7 +1103,7 @@ self.sendUploadResponse = async (req, res, result) => { // If uploaded by user, add delete URL (intended for ShareX and its derivatives) // Homepage uploader will not use this (use dashboard instead) if (req.locals.user) { - map.deleteUrl = `${utils.conf.homeDomain}/file/${file.name}?delete` + map.deleteUrl = `${utils.conf.homeDomain || ''}/file/${file.name}?delete` } return map