mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 13:00:56 +03:00
Refactor/Update code execution sandbox implementation across components (#4904)
refactor: Update code execution sandbox implementation across components - Replaced NodeVM usage with a new createCodeExecutionSandbox function for improved sandbox management. - Enhanced JavaScript code execution with executeJavaScriptCode function, allowing for better handling of libraries and output streaming. - Updated multiple components to utilize the new sandboxing approach, ensuring consistent execution environment. - Added validation for UUIDs and URLs in various tools to enhance input safety. - Refactored input handling in CustomFunction and IfElseFunction to streamline variable management.
This commit is contained in:
@@ -9,6 +9,20 @@ export const isValidUUID = (uuid: string): boolean => {
|
||||
return uuidV4Pattern.test(uuid)
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates if a string is a valid URL
|
||||
* @param {string} url The string to validate
|
||||
* @returns {boolean} True if valid URL, false otherwise
|
||||
*/
|
||||
export const isValidURL = (url: string): boolean => {
|
||||
try {
|
||||
new URL(url)
|
||||
return true
|
||||
} catch {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates if a string contains path traversal attempts
|
||||
* @param {string} path The string to validate
|
||||
|
||||
Reference in New Issue
Block a user