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

Signed-off-by: -LAN- <laipz8200@outlook.com>
This commit is contained in:
-LAN- 2024-11-24 21:10:01 +08:00 committed by GitHub
parent 365a40d11f
commit 04f1e18342
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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: