mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-10 03:16:51 +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:
@@ -241,7 +241,11 @@ def _is_file_valid_with_config(
|
|||||||
):
|
):
|
||||||
return False
|
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
|
return False
|
||||||
|
|
||||||
if config.allowed_file_upload_methods and file_transfer_method not in config.allowed_file_upload_methods:
|
if config.allowed_file_upload_methods and file_transfer_method not in config.allowed_file_upload_methods:
|
||||||
|
|||||||
Reference in New Issue
Block a user