diff --git a/web/app/components/workflow/nodes/http/default.ts b/web/app/components/workflow/nodes/http/default.ts index 8b712c4c04..9b3f9a40f0 100644 --- a/web/app/components/workflow/nodes/http/default.ts +++ b/web/app/components/workflow/nodes/http/default.ts @@ -1,6 +1,7 @@ import { BlockEnum } from '../../types' import type { NodeDefault } from '../../types' -import { AuthorizationType, BodyType, type HttpNodeType, Method } from './types' +import { AuthorizationType, BodyType, Method } from './types' +import type { BodyPayload, HttpNodeType } from './types' import { ALL_CHAT_AVAILABLE_BLOCKS, ALL_COMPLETION_AVAILABLE_BLOCKS } from '@/app/components/workflow/constants' const nodeDefault: NodeDefault = { @@ -40,7 +41,10 @@ const nodeDefault: NodeDefault = { if (!errorMessages && !payload.url) errorMessages = t('workflow.errorMsg.fieldRequired', { field: t('workflow.nodes.http.api') }) - if (!errorMessages && payload.body.type === BodyType.binary && !payload.body.binaryFileVariable) + if (!errorMessages + && payload.body.type === BodyType.binary + && ((!(payload.body.data as BodyPayload)[0]?.file) || (payload.body.data as BodyPayload)[0]?.file?.length === 0) + ) errorMessages = t('workflow.errorMsg.fieldRequired', { field: t('workflow.nodes.http.binaryFileVariable') }) return {