Update packages/server/src/utils/createAttachment.ts
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
parent
f4281457df
commit
0ad98a0c29
|
|
@ -32,7 +32,7 @@ export const createFileAttachment = async (req: Request) => {
|
||||||
if (!chatflowid || !isValidUUID(chatflowid)) {
|
if (!chatflowid || !isValidUUID(chatflowid)) {
|
||||||
throw new InternalFlowiseError(StatusCodes.BAD_REQUEST, 'Invalid chatflowId format - must be a valid UUID')
|
throw new InternalFlowiseError(StatusCodes.BAD_REQUEST, 'Invalid chatflowId format - must be a valid UUID')
|
||||||
}
|
}
|
||||||
if (isPathTraversal(chatflowid) || isPathTraversal(chatId)) {
|
if (isPathTraversal(chatflowid) || (chatId && isPathTraversal(chatId))) {
|
||||||
throw new InternalFlowiseError(StatusCodes.BAD_REQUEST, 'Invalid path characters detected')
|
throw new InternalFlowiseError(StatusCodes.BAD_REQUEST, 'Invalid path characters detected')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue