From 2cad2241e1d3e8f2a758d7ba472902e7d25be43f Mon Sep 17 00:00:00 2001 From: "Patrik J. Braun" Date: Thu, 18 Jul 2019 23:06:54 +0200 Subject: [PATCH] solving absolute server path exposing issue --- backend/middlewares/GalleryMWs.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/middlewares/GalleryMWs.ts b/backend/middlewares/GalleryMWs.ts index f2d1309..5db7c56 100644 --- a/backend/middlewares/GalleryMWs.ts +++ b/backend/middlewares/GalleryMWs.ts @@ -167,7 +167,7 @@ export class GalleryMWs { // check if thumbnail already exist if (fs.existsSync(fullMediaPath) === false) { - return next(new ErrorDTO(ErrorCodes.GENERAL_ERROR, 'no such file:' + fullMediaPath)); + return next(new ErrorDTO(ErrorCodes.GENERAL_ERROR, 'no such file:' + req.params.mediaPath, 'can\'t find file: ' + fullMediaPath)); } if (fs.statSync(fullMediaPath).isDirectory()) { return next();