Chore/Prevent invalid http redirect (#4990)

prevent invalid http redirect
This commit is contained in:
Henry Heng
2025-07-31 12:24:08 +01:00
committed by GitHub
parent ed27ad0c58
commit 89a806f722
6 changed files with 181 additions and 30 deletions
@@ -1,7 +1,6 @@
import { z } from 'zod'
import fetch from 'node-fetch'
import { DynamicStructuredTool } from '../OpenAPIToolkit/core'
import { checkDenyList } from '../../../src/httpSecurity'
import { secureFetch } from '../../../src/httpSecurity'
export const desc = `Use this when you need to execute a DELETE request to remove data from a website.`
@@ -166,11 +165,8 @@ 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, {
const res = await secureFetch(finalUrl, {
method: 'DELETE',
headers: requestHeaders
})