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:
parent
572f6d833d
commit
400167f4ef
@ -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)) {
|
||||
|
@ -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)));
|
||||
},
|
||||
}),
|
||||
};
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user