From a2608c319a8c31f9b173dbb5d00221d3ad96739b Mon Sep 17 00:00:00 2001 From: Sheogorath Date: Sat, 23 Jun 2018 21:47:22 +0200 Subject: Fix possible error if HackMD is started with wrong workdir In https://github.com/hackmdio/hackmd/issues/834 is described how starting HackMD crashes when using the wrong working dir. This is caused by a relative path in our upload routine. This change should fix it and prevent future crashes. Signed-off-by: Sheogorath --- lib/web/imageRouter/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/web/imageRouter') diff --git a/lib/web/imageRouter/index.js b/lib/web/imageRouter/index.js index f7e031af..f3c2decf 100644 --- a/lib/web/imageRouter/index.js +++ b/lib/web/imageRouter/index.js @@ -16,7 +16,7 @@ imageRouter.post('/uploadimage', function (req, res) { form.keepExtensions = true if (config.imageUploadType === 'filesystem') { - form.uploadDir = 'public/uploads' + form.uploadDir = config.uploadsPath } form.parse(req, function (err, fields, files) { -- cgit v1.2.3