mirror of https://github.com/tiangolo/fastapi.git
Fix handling of value when multiple files in form-data
It appears that the value list extracted from the `FormData` is not necessarily composed of `UploadFile` instances.
This commit is contained in:
parent
6ce6c8954c
commit
167fed622c
|
|
@ -778,7 +778,10 @@ async def request_body_to_args(
|
|||
|
||||
async with anyio.create_task_group() as tg:
|
||||
for sub_value in value:
|
||||
tg.start_soon(process_fn, sub_value.read)
|
||||
if isinstance(sub_value, UploadFile):
|
||||
tg.start_soon(process_fn, sub_value.read)
|
||||
else:
|
||||
results.append(sub_value)
|
||||
value = sequence_shape_to_type[field.shape](results)
|
||||
|
||||
v_, errors_ = field.validate(value, values, loc=loc)
|
||||
|
|
|
|||
Loading…
Reference in New Issue