mirror of
https://github.com/immich-app/immich.git
synced 2024-12-26 10:50:29 +02:00
chore(server): check file extension for XMP instead of mimetype (#2990)
* just check file extension for XMP instead of mimetype * use path to get extension instead of regex * single quotes * remove unused import --------- Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
parent
792ecc6cac
commit
22a73b67d3
@ -7,7 +7,6 @@ import {
|
|||||||
ICryptoRepository,
|
ICryptoRepository,
|
||||||
IJobRepository,
|
IJobRepository,
|
||||||
ImmichReadStream,
|
ImmichReadStream,
|
||||||
isSidecarFileType,
|
|
||||||
isSupportedFileType,
|
isSupportedFileType,
|
||||||
IStorageRepository,
|
IStorageRepository,
|
||||||
JobName,
|
JobName,
|
||||||
@ -152,9 +151,8 @@ export class AssetService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (dto.sidecarPath) {
|
if (dto.sidecarPath) {
|
||||||
const sidecarType = mime.lookup(dto.sidecarPath) as string;
|
if (path.extname(dto.sidecarPath).toLowerCase() !== '.xmp') {
|
||||||
if (!isSidecarFileType(sidecarType)) {
|
throw new BadRequestException(`Unsupported sidecar file type`);
|
||||||
throw new BadRequestException(`Unsupported sidecar file type ${assetPathType}`);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user