mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-21 03:42:16 +00:00
fix(editor): Sanitize HTML binary-data before rendering in the UI (#7400)
This commit is contained in:
committed by
GitHub
parent
47e8953ec9
commit
2b075bfc2d
@@ -35,7 +35,7 @@ export type IAllExecuteFunctions =
|
||||
| ITriggerFunctions
|
||||
| IWebhookFunctions;
|
||||
|
||||
export type BinaryFileType = 'text' | 'json' | 'image' | 'audio' | 'video' | 'pdf';
|
||||
export type BinaryFileType = 'text' | 'json' | 'image' | 'audio' | 'video' | 'pdf' | 'html';
|
||||
export interface IBinaryData {
|
||||
[key: string]: string | undefined;
|
||||
data: string;
|
||||
|
||||
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user