mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-29 09:01:06 +03:00
Chore/deny list urls (#4938)
* Refactor URL filtering logic in App class - Introduced a denylist for URLs using the DENYLIST_URLS environment variable. - Updated the whitelist logic to filter out denylisted URLs, ensuring improved request validation. * revery whitelist url changes * revert whitelist url changes
This commit is contained in:
@@ -210,7 +210,7 @@ export class App {
|
|||||||
// Step 2: Check if the req path is casesensitive
|
// Step 2: Check if the req path is casesensitive
|
||||||
if (URL_CASE_SENSITIVE_REGEX.test(req.path)) {
|
if (URL_CASE_SENSITIVE_REGEX.test(req.path)) {
|
||||||
// Step 3: Check if the req path is in the whitelist
|
// Step 3: Check if the req path is in the whitelist
|
||||||
const isWhitelisted = whitelistURLs.includes(req.path)
|
const isWhitelisted = whitelistURLs.some((url) => req.path.startsWith(url))
|
||||||
if (isWhitelisted) {
|
if (isWhitelisted) {
|
||||||
next()
|
next()
|
||||||
} else if (req.headers['x-request-from'] === 'internal') {
|
} else if (req.headers['x-request-from'] === 'internal') {
|
||||||
|
|||||||
Reference in New Issue
Block a user