mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-06-04 11:14:10 +08:00
fix: validation for upload methods of non-image files within the work… (#15932)
This commit is contained in:
parent
cee8731393
commit
e6a8800f66
@ -289,8 +289,14 @@ def _is_file_valid_with_config(
|
|||||||
):
|
):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if input_file_type == FileType.IMAGE and config.image_config:
|
if input_file_type == FileType.IMAGE:
|
||||||
if config.image_config.transfer_methods and file_transfer_method not in config.image_config.transfer_methods:
|
if (
|
||||||
|
config.image_config
|
||||||
|
and config.image_config.transfer_methods
|
||||||
|
and file_transfer_method not in config.image_config.transfer_methods
|
||||||
|
):
|
||||||
|
return False
|
||||||
|
elif config.allowed_file_upload_methods and file_transfer_method not in config.allowed_file_upload_methods:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
Loading…
x
Reference in New Issue
Block a user