Просмотр исходного кода

Normalize file extension to lowercase in isVectorStoreCompatible function

Shun Miyazawa 11 месяцев назад
Родитель
Сommit
e0e5e2ee9c

+ 1 - 1
apps/app/src/features/openai/server/utils/is-vector-store-compatible.ts

@@ -29,7 +29,7 @@ type SupportedExtension = keyof typeof supportedFormats;
 
 export const isVectorStoreCompatible = (file: Express.Multer.File): boolean => {
   // Get extension
-  const extension = path.extname(file.originalname);
+  const extension = path.extname(file.originalname).toLowerCase();
 
   // Check if the file extension is supported
   if (!(extension in supportedFormats)) {