浏览代码

fix: Validate file only when file type is set to custom (#11036)

Signed-off-by: -LAN- <laipz8200@outlook.com>
-LAN- 5 月之前
父节点
当前提交
04f1e18342
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      api/factories/file_factory.py

+ 5 - 1
api/factories/file_factory.py

@@ -241,7 +241,11 @@ def _is_file_valid_with_config(
     ):
         return False
 
-    if config.allowed_file_extensions and file_extension not in config.allowed_file_extensions:
+    if (
+        input_file_type == FileType.CUSTOM
+        and config.allowed_file_extensions is not None
+        and file_extension not in config.allowed_file_extensions
+    ):
         return False
 
     if config.allowed_file_upload_methods and file_transfer_method not in config.allowed_file_upload_methods: