1
0
mirror of https://github.com/immich-app/immich.git synced 2024-12-25 10:43:13 +02:00

fix(server): sanitization error that crash the server (#721)

This commit is contained in:
Alex 2022-09-18 21:44:13 -05:00 committed by GitHub
parent 572f6d833d
commit 400167f4ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -25,7 +25,7 @@ export const assetUploadOption: MulterOptions = {
return;
}
const sanitizedDeviceId = sanitize(req.body['deviceId']);
const sanitizedDeviceId = sanitize(String(req.body['deviceId']));
const originalUploadFolder = join(basePath, req.user.id, 'original', sanitizedDeviceId);
if (!existsSync(originalUploadFolder)) {

View File

@ -38,7 +38,7 @@ export const profileImageUploadOption: MulterOptions = {
const userId = req.user.id;
const fileName = `${userId}${extname(file.originalname)}`;
cb(null, sanitize(fileName));
cb(null, sanitize(String(fileName)));
},
}),
};

View File

@ -52,7 +52,7 @@ export class ThumbnailGeneratorProcessor {
const basePath = APP_UPLOAD_LOCATION;
const { asset } = job.data;
const sanitizedDeviceId = sanitize(asset.deviceId);
const sanitizedDeviceId = sanitize(String(asset.deviceId));
const resizePath = join(basePath, asset.userId, 'thumb', sanitizedDeviceId);