fix(editor): Sanitize HTML binary-data before rendering in the UI (#7400)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2023-10-11 12:09:19 +02:00
committed by GitHub
parent 47e8953ec9
commit 2b075bfc2d
7 changed files with 31 additions and 21 deletions

View File

@@ -112,6 +112,7 @@ export const sleep = async (ms: number): Promise<void> =>
export function fileTypeFromMimeType(mimeType: string): BinaryFileType | undefined {
if (mimeType.startsWith('application/json')) return 'json';
if (mimeType.startsWith('text/html')) return 'html';
if (mimeType.startsWith('image/')) return 'image';
if (mimeType.startsWith('audio/')) return 'audio';
if (mimeType.startsWith('video/')) return 'video';