mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-29 09:01:06 +03:00
@@ -1,6 +1,7 @@
|
||||
import { z } from 'zod'
|
||||
import fetch from 'node-fetch'
|
||||
import { DynamicStructuredTool } from '../OpenAPIToolkit/core'
|
||||
import { checkDenyList } from '../../../src/httpSecurity'
|
||||
|
||||
export const desc = `Use this when you need to execute a DELETE request to remove data from a website.`
|
||||
|
||||
@@ -165,6 +166,9 @@ export class RequestsDeleteTool extends DynamicStructuredTool {
|
||||
finalUrl = url.toString()
|
||||
}
|
||||
|
||||
// Check if URL is allowed by security policy
|
||||
await checkDenyList(finalUrl)
|
||||
|
||||
try {
|
||||
const res = await fetch(finalUrl, {
|
||||
method: 'DELETE',
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { z } from 'zod'
|
||||
import fetch from 'node-fetch'
|
||||
import { DynamicStructuredTool } from '../OpenAPIToolkit/core'
|
||||
import { checkDenyList } from '../../../src/httpSecurity'
|
||||
|
||||
export const desc = `Use this when you need to execute a GET request to get data from a website.`
|
||||
|
||||
@@ -165,6 +166,9 @@ export class RequestsGetTool extends DynamicStructuredTool {
|
||||
finalUrl = url.toString()
|
||||
}
|
||||
|
||||
// Check if URL is allowed by security policy
|
||||
await checkDenyList(finalUrl)
|
||||
|
||||
try {
|
||||
const res = await fetch(finalUrl, {
|
||||
headers: requestHeaders
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { z } from 'zod'
|
||||
import fetch from 'node-fetch'
|
||||
import { DynamicStructuredTool } from '../OpenAPIToolkit/core'
|
||||
import { checkDenyList } from '../../../src/httpSecurity'
|
||||
|
||||
export const desc = `Use this when you want to execute a POST request to create or update a resource.`
|
||||
|
||||
@@ -126,6 +127,9 @@ export class RequestsPostTool extends DynamicStructuredTool {
|
||||
...this.headers
|
||||
}
|
||||
|
||||
// Check if URL is allowed by security policy
|
||||
await checkDenyList(inputUrl)
|
||||
|
||||
const res = await fetch(inputUrl, {
|
||||
method: 'POST',
|
||||
headers: requestHeaders,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { z } from 'zod'
|
||||
import fetch from 'node-fetch'
|
||||
import { DynamicStructuredTool } from '../OpenAPIToolkit/core'
|
||||
import { checkDenyList } from '../../../src/httpSecurity'
|
||||
|
||||
export const desc = `Use this when you want to execute a PUT request to update or replace a resource.`
|
||||
|
||||
@@ -126,6 +127,9 @@ export class RequestsPutTool extends DynamicStructuredTool {
|
||||
...this.headers
|
||||
}
|
||||
|
||||
// Check if URL is allowed by security policy
|
||||
await checkDenyList(inputUrl)
|
||||
|
||||
const res = await fetch(inputUrl, {
|
||||
method: 'PUT',
|
||||
headers: requestHeaders,
|
||||
|
||||
Reference in New Issue
Block a user