mirror of
https://github.com/immich-app/immich.git
synced 2025-12-15 06:24:23 +03:00
chore: validate filename for deletion
This commit is contained in:
@@ -16,6 +16,10 @@ export class DatabaseBackupService extends BaseService {
|
||||
}
|
||||
|
||||
async deleteBackup(files: string[]): Promise<void> {
|
||||
if (files.some((filename) => !isValidBackupName(filename))) {
|
||||
throw new BadRequestException('Invalid backup name!');
|
||||
}
|
||||
|
||||
await Promise.all(files.map((filename) => deleteBackup(this.backupRepos, basename(filename))));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user