Skip to content

Commit

Permalink
Fixing issue where zipped file content is not sanitized
Browse files Browse the repository at this point in the history
  • Loading branch information
ehamai committed Dec 3, 2023
1 parent 96be76d commit d1c8250
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/common/fileUpload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const onFileUpload = async (event: React.ChangeEvent<HTMLInputElement>,
sanitize(parsedContent, sanitizationCategories);

const zip = new JSZip();
zip.file(`${fileNamePrefix}.har`, content);
zip.file(`${fileNamePrefix}.har`, JSON.stringify(parsedContent));
const blob = await zip.generateAsync({
type: 'blob',
compression: 'DEFLATE',
Expand All @@ -55,7 +55,7 @@ export const onFileUpload = async (event: React.ChangeEvent<HTMLInputElement>,
console.log(url);
setDownloadUrl(url);
} catch (e) {
console.log('Failed to parse file');
console.log(`Failed to parse and zip file: ${e}`);
}
}
}

0 comments on commit d1c8250

Please sign in to comment.