Bugfix/Securely Fetch Links (#5200)

- Added `secureFetch` and `checkDenyList` functions from `httpSecurity` to enhance security in web crawling and link fetching processes.
- Updated relevant functions to utilize these new security measures, ensuring safer data handling.
This commit is contained in:
Henry Heng
2025-09-12 16:34:28 +01:00
committed by GitHub
parent 4987a2880d
commit e002e617df
3 changed files with 9 additions and 3 deletions
@@ -1,4 +1,4 @@
import { webCrawl, xmlScrape } from 'flowise-components'
import { webCrawl, xmlScrape, checkDenyList } from 'flowise-components'
import { StatusCodes } from 'http-status-codes'
import { InternalFlowiseError } from '../../errors/internalFlowiseError'
import { getErrorMessage } from '../../errors/utils'
@@ -6,6 +6,8 @@ import { getErrorMessage } from '../../errors/utils'
const getAllLinks = async (requestUrl: string, relativeLinksMethod: string, queryLimit: string): Promise<any> => {
try {
const url = decodeURIComponent(requestUrl)
await checkDenyList(url)
if (!relativeLinksMethod) {
throw new InternalFlowiseError(
StatusCodes.INTERNAL_SERVER_ERROR,