mirror of
https://github.com/open-webui/open-webui.git
synced 2026-09-28 01:31:28 +00:00
fix: guard JSON parsing on upload response for non-JSON success bodies
This commit is contained in:
parent
4cbbe73376
commit
b2b0702eea
1 changed files with 4 additions and 1 deletions
|
|
@ -2965,7 +2965,10 @@ async def upload_file_to_terminal(
|
|||
return json.dumps(
|
||||
{'error': f'Upload failed (HTTP {response.status}): {detail}'}
|
||||
)
|
||||
result = await response.json()
|
||||
try:
|
||||
result = await response.json()
|
||||
except Exception:
|
||||
result = {}
|
||||
|
||||
return json.dumps(
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue