Skip to content

Commit

Permalink
fix(multipart): support multipart file inputs to non-file descriptors
Browse files Browse the repository at this point in the history
  • Loading branch information
sauyon committed Sep 15, 2022
1 parent ff7ebe7 commit 78f3cfe
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bentoml/_internal/utils/formparser.py
Expand Up @@ -200,6 +200,10 @@ async def populate_multipart_requests(request: Request) -> t.Dict[str, Request]:
req._form = FormData([(field_name, data)]) # type: ignore (using internal starlette APIs)
if isinstance(data, bytes):
req._body = data
else:
req._receive = ( # type: ignore (using internal starlette APIs)
data.read() # formatted to preserve type checking
)
reqs[field_name] = req
return reqs

Expand Down

0 comments on commit 78f3cfe

Please sign in to comment.