mirror of
https://github.com/immich-app/immich.git
synced 2024-12-25 10:43:13 +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,
|
||||
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`);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user