Skip to content

Commit 9e2eb51

Browse files
committed
fix:codeql scan Security issue
1 parent 365f4e7 commit 9e2eb51

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎base/src/main/java/com/tinyengine/it/rag/service/StorageService.java‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,12 @@ public Map<String, List<EmbeddingMatchDto>> searchAcrossCollections(SearchReques
789789
*/
790790
public DeleteResult deleteByFilePath(String filePath, String collectionName) {
791791
try {
792-
String safeFilePath = resolveDocumentPath(filePath).toString();
792+
final Path documentRoot = getDocumentRoot();
793+
final Path resolvedPath = resolveDocumentPath(filePath, documentRoot);
794+
final String safeFilePath =
795+
Files.exists(resolvedPath)
796+
? resolveRealDocumentPath(resolvedPath, documentRoot).toString()
797+
: resolvedPath.toString();
793798
logInfo(
794799
"Deleting documents by file path: {} from collection: {}",
795800
safeFilePath,

0 commit comments

Comments
 (0)