forked from phoenix/litellm-mirror
(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
|
import ast, json
|
||||||
|
|
||||||
request_data = {}
|
request_data = {}
|
||||||
|
if request is None:
|
||||||
|
return request_data
|
||||||
body = await request.body()
|
body = await request.body()
|
||||||
|
|
||||||
|
if body == b"" or body is None:
|
||||||
|
return request_data
|
||||||
body_str = body.decode()
|
body_str = body.decode()
|
||||||
try:
|
try:
|
||||||
request_data = ast.literal_eval(body_str)
|
request_data = ast.literal_eval(body_str)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue