mirror of https://github.com/tiangolo/fastapi.git
fix: allow callabe in dependant for get_request_handler
This commit is contained in:
parent
a94ef3351e
commit
f8074c72d9
|
|
@ -208,7 +208,11 @@ def get_request_handler(
|
|||
dependency_overrides_provider: Optional[Any] = None,
|
||||
) -> Callable[[Request], Coroutine[Any, Any, Response]]:
|
||||
assert dependant.call is not None, "dependant.call must be a function"
|
||||
is_coroutine = asyncio.iscoroutinefunction(dependant.call)
|
||||
is_coroutine = (
|
||||
asyncio.iscoroutinefunction(dependant.call)
|
||||
or callable(dependant.call)
|
||||
and inspect.iscoroutinefunction(dependant.call.__call__)
|
||||
)
|
||||
is_body_form = body_field and isinstance(body_field.field_info, params.Form)
|
||||
if isinstance(response_class, DefaultPlaceholder):
|
||||
actual_response_class: Type[Response] = response_class.value
|
||||
|
|
|
|||
Loading…
Reference in New Issue