mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-11 18:09:05 +08:00
fix: Validate file only when file type is set to custom (#11036)
Signed-off-by: -LAN- <laipz8200@outlook.com>
This commit is contained in:
parent
365a40d11f
commit
04f1e18342
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user