A one-of-a-kind resume builder that keeps your privacy in mind. Completely secure, customizable, portable, open-source and free forever. Try it out today!
TypeScript agent-skillsaidsh-pluginhacktoberfestjavascriptmcp-serverreactresume-builderself-hostedtypescript
Fix server crash when non-zip file is uploaded
Krisjanis Lejejse9e595f0d0ef
diff --git a/server/src/integrations/integrations.service.ts b/server/src/integrations/integrations.service.tsindex a9cd063ee..60cb34ada 100644--- a/server/src/integrations/integrations.service.ts+++ b/server/src/integrations/integrations.service.ts@@ -35,6 +35,7 @@ export class IntegrationsService {async linkedIn(userId: number, path: string): Promise<ResumeEntity> {let archive: StreamZip.StreamZipAsync;+ let isArchiveValid = false;try {archive = new StreamZip.async({ file: path });@@ -48,6 +49,9 @@ export class IntegrationsService {slug: `imported-from-linkedin-${timestamp}`,});+ // Check if archive is valid+ isArchiveValid = await archive.entries().then((entries) => Object.keys(entries).length > 0);+// Profiletry {const profileCSV = (await archive.entryData('Profile.csv')).toString();@@ -261,7 +265,7 @@ export class IntegrationsService {throw new HttpException('You must upload a valid zip archive downloaded from LinkedIn.', HttpStatus.BAD_REQUEST);} finally {await unlink(path);- !isEmpty(archive) && archive.close();+ isArchiveValid && archive.close();}}