Fix: crash of workflow file upload (#10831)

Co-authored-by: -LAN- <laipz8200@outlook.com>
Co-authored-by: StyleZhang <jasonapring2015@outlook.com>
This commit is contained in:
KVOJJJin
2024-11-19 14:15:18 +08:00
committed by GitHub
parent 133de9a087
commit 328965ed7c
9 changed files with 65 additions and 24 deletions

View File

@@ -233,10 +233,10 @@ def _is_file_valid_with_config(*, file: File, config: FileUploadConfig) -> bool:
if config.allowed_file_types and file.type not in config.allowed_file_types and file.type != FileType.CUSTOM:
return False
if config.allowed_extensions and file.extension not in config.allowed_extensions:
if config.allowed_file_extensions and file.extension not in config.allowed_file_extensions:
return False
if config.allowed_upload_methods and file.transfer_method not in config.allowed_upload_methods:
if config.allowed_file_upload_methods and file.transfer_method not in config.allowed_file_upload_methods:
return False
if file.type == FileType.IMAGE and config.image_config: