mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 18:41:14 +00:00
fix(editor): Restrict what binary-data types can be viewed in the UI (#14685)
This commit is contained in:
committed by
GitHub
parent
68a87619af
commit
11a36b758d
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { ViewableMimeTypes } from '@n8n/api-types';
|
||||
import { useStorage } from '@/composables/useStorage';
|
||||
import { saveAs } from 'file-saver';
|
||||
import type {
|
||||
@@ -1182,10 +1183,8 @@ function closeBinaryDataDisplay() {
|
||||
}
|
||||
|
||||
function isViewable(index: number, key: string | number): boolean {
|
||||
const { fileType } = binaryData.value[index][key];
|
||||
return (
|
||||
!!fileType && ['image', 'audio', 'video', 'text', 'json', 'pdf', 'html'].includes(fileType)
|
||||
);
|
||||
const { mimeType } = binaryData.value[index][key];
|
||||
return ViewableMimeTypes.includes(mimeType);
|
||||
}
|
||||
|
||||
function isDownloadable(index: number, key: string | number): boolean {
|
||||
|
||||
Reference in New Issue
Block a user