Chore/add http denylist checks (#4985)

add http denylist checks
This commit is contained in:
Henry Heng
2025-07-30 17:16:40 +01:00
committed by GitHub
parent e8dac2048f
commit 0998bf4327
6 changed files with 70 additions and 41 deletions
@@ -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