mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
(fix) ui - when request body is None
This commit is contained in:
parent
8939593826
commit
258fe63e7d
1 changed files with 5 additions and 0 deletions
|
@ -1252,7 +1252,12 @@ async def _read_request_body(request):
|
|||
import ast, json
|
||||
|
||||
request_data = {}
|
||||
if request is None:
|
||||
return request_data
|
||||
body = await request.body()
|
||||
|
||||
if body == b"" or body is None:
|
||||
return request_data
|
||||
body_str = body.decode()
|
||||
try:
|
||||
request_data = ast.literal_eval(body_str)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue