Skip to content

High performance self-hosted photo and video management solution.

chore(server): check file extension for XMP instead of mimetype (#2990)

Alex Phillips22a73b67d34f
diff --git a/server/src/immich/api-v1/asset/asset.service.ts b/server/src/immich/api-v1/asset/asset.service.ts
index 6ce6c907b3..53335ceaf2 100644
--- a/server/src/immich/api-v1/asset/asset.service.ts
+++ b/server/src/immich/api-v1/asset/asset.service.ts
@@ -7,7 +7,6 @@ import {
ICryptoRepository,
IJobRepository,
ImmichReadStream,
- isSidecarFileType,
isSupportedFileType,
IStorageRepository,
JobName,
@@ -152,9 +151,8 @@ export class AssetService {
}
if (dto.sidecarPath) {
- const sidecarType = mime.lookup(dto.sidecarPath) as string;
- if (!isSidecarFileType(sidecarType)) {
- throw new BadRequestException(`Unsupported sidecar file type ${assetPathType}`);
+ if (path.extname(dto.sidecarPath).toLowerCase() !== '.xmp') {
+ throw new BadRequestException(`Unsupported sidecar file type`);
}
}