mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-14 00:55:53 +08:00
fix: workflow http node timeout & url check (#4175)
This commit is contained in:
parent
4aa21242b6
commit
8137d63000
@ -68,7 +68,7 @@ const Timeout: FC<Props> = ({ readonly, payload, onChange }) => {
|
|||||||
value={connect}
|
value={connect}
|
||||||
onChange={v => onChange?.({ ...payload, connect: v })}
|
onChange={v => onChange?.({ ...payload, connect: v })}
|
||||||
min={1}
|
min={1}
|
||||||
max={max_connect_timeout ?? 300}
|
max={max_connect_timeout || 300}
|
||||||
/>
|
/>
|
||||||
<InputField
|
<InputField
|
||||||
title={t('workflow.nodes.http.timeout.readLabel')!}
|
title={t('workflow.nodes.http.timeout.readLabel')!}
|
||||||
@ -78,7 +78,7 @@ const Timeout: FC<Props> = ({ readonly, payload, onChange }) => {
|
|||||||
value={read}
|
value={read}
|
||||||
onChange={v => onChange?.({ ...payload, read: v })}
|
onChange={v => onChange?.({ ...payload, read: v })}
|
||||||
min={1}
|
min={1}
|
||||||
max={max_read_timeout ?? 600}
|
max={max_read_timeout || 600}
|
||||||
/>
|
/>
|
||||||
<InputField
|
<InputField
|
||||||
title={t('workflow.nodes.http.timeout.writeLabel')!}
|
title={t('workflow.nodes.http.timeout.writeLabel')!}
|
||||||
@ -88,7 +88,7 @@ const Timeout: FC<Props> = ({ readonly, payload, onChange }) => {
|
|||||||
value={write}
|
value={write}
|
||||||
onChange={v => onChange?.({ ...payload, write: v })}
|
onChange={v => onChange?.({ ...payload, write: v })}
|
||||||
min={1}
|
min={1}
|
||||||
max={max_write_timeout ?? 600}
|
max={max_write_timeout || 600}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -40,9 +40,6 @@ const nodeDefault: NodeDefault<HttpNodeType> = {
|
|||||||
if (!errorMessages && !payload.url)
|
if (!errorMessages && !payload.url)
|
||||||
errorMessages = t('workflow.errorMsg.fieldRequired', { field: t('workflow.nodes.http.api') })
|
errorMessages = t('workflow.errorMsg.fieldRequired', { field: t('workflow.nodes.http.api') })
|
||||||
|
|
||||||
if (!errorMessages && !payload.url.startsWith('http://') && !payload.url.startsWith('https://'))
|
|
||||||
errorMessages = t('workflow.nodes.http.notStartWithHttp')
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
isValid: !errorMessages,
|
isValid: !errorMessages,
|
||||||
errorMessage: errorMessages,
|
errorMessage: errorMessages,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user