feat: Allow to change SSL verify in HTTP Node (#22052)

Co-authored-by: crazywoola <427733928@qq.com>
This commit is contained in:
Davide Delbianco
2025-07-09 09:53:24 +02:00
committed by GitHub
parent 89b52471fb
commit 1885426421
25 changed files with 106 additions and 1 deletions

View File

@@ -22,6 +22,7 @@ const nodeDefault: NodeDefault<HttpNodeType> = {
type: BodyType.none,
data: [],
},
ssl_verify: true,
timeout: {
max_connect_timeout: 0,
max_read_timeout: 0,

View File

@@ -10,6 +10,7 @@ import type { HttpNodeType } from './types'
import Timeout from './components/timeout'
import CurlPanel from './components/curl-panel'
import cn from '@/utils/classnames'
import Switch from '@/app/components/base/switch'
import Field from '@/app/components/workflow/nodes/_base/components/field'
import Split from '@/app/components/workflow/nodes/_base/components/split'
import OutputVars, { VarItem } from '@/app/components/workflow/nodes/_base/components/output-vars'
@@ -47,6 +48,7 @@ const Panel: FC<NodePanelProps<HttpNodeType>> = ({
showCurlPanel,
hideCurlPanel,
handleCurlImport,
handleSSLVerifyChange,
} = useConfig(id, data)
// To prevent prompt editor in body not update data.
if (!isDataReady)
@@ -124,6 +126,18 @@ const Panel: FC<NodePanelProps<HttpNodeType>> = ({
onChange={setBody}
/>
</Field>
<Field
title={t(`${i18nPrefix}.verifySSL.title`)}
tooltip={t(`${i18nPrefix}.verifySSL.warningTooltip`)}
operations={
<Switch
defaultValue={!!inputs.ssl_verify}
onChange={handleSSLVerifyChange}
size='md'
disabled={readOnly}
/>
}>
</Field>
</div>
<Split />
<Timeout

View File

@@ -81,4 +81,5 @@ export type HttpNodeType = CommonNodeType & {
body: Body
authorization: Authorization
timeout: Timeout
ssl_verify?: boolean
}

View File

@@ -141,6 +141,13 @@ const useConfig = (id: string, payload: HttpNodeType) => {
setInputs(newInputs)
}, [inputs, setInputs])
const handleSSLVerifyChange = useCallback((checked: boolean) => {
const newInputs = produce(inputs, (draft: HttpNodeType) => {
draft.ssl_verify = checked
})
setInputs(newInputs)
}, [inputs, setInputs])
return {
readOnly,
isDataReady,
@@ -164,6 +171,8 @@ const useConfig = (id: string, payload: HttpNodeType) => {
toggleIsParamKeyValueEdit,
// body
setBody,
// ssl verify
handleSSLVerifyChange,
// authorization
isShowAuthorization,
showAuthorization,