From 12cd74727065079905cb385119d7a2db35276cca Mon Sep 17 00:00:00 2001 From: WilliButz Date: Wed, 26 Sep 2018 20:40:28 +0200 Subject: imageRouter/filesystem: make callback path-independent Images are now properly served when `config.uploadsPath` differs from its default value. Signed-off-by: WilliButz --- lib/web/imageRouter/filesystem.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/web') diff --git a/lib/web/imageRouter/filesystem.js b/lib/web/imageRouter/filesystem.js index 4bf82b31..8c432b0c 100644 --- a/lib/web/imageRouter/filesystem.js +++ b/lib/web/imageRouter/filesystem.js @@ -1,5 +1,6 @@ 'use strict' const url = require('url') +const path = require('path') const config = require('../../config') const logger = require('../../logger') @@ -15,5 +16,5 @@ exports.uploadImage = function (imagePath, callback) { return } - callback(null, url.resolve(config.serverURL + '/', imagePath.match(/public\/(.+)$/)[1])) + callback(null, url.resolve(config.serverURL + '/uploads/', path.basename(imagePath))) } -- cgit v1.2.3 From bb80bc2292d2841776e8bfd6285f96194d990284 Mon Sep 17 00:00:00 2001 From: Claudius Date: Mon, 10 Sep 2018 22:35:38 +0200 Subject: removing superfluous config parameters for template files Signed-off-by: Claudius --- lib/web/statusRouter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/web') diff --git a/lib/web/statusRouter.js b/lib/web/statusRouter.js index 7ecf3839..fb2609ea 100644 --- a/lib/web/statusRouter.js +++ b/lib/web/statusRouter.js @@ -105,5 +105,5 @@ statusRouter.get('/config', function (req, res) { 'X-Robots-Tag': 'noindex, nofollow', // prevent crawling 'Content-Type': 'application/javascript' }) - res.render(config.constantsPath, data) + res.render('../js/lib/common/constant.ejs', data) }) -- cgit v1.2.3