Преглед на файлове

Fix code scanning alert no. 149: Information exposure through an exception

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Timothy Jaeryang Baek преди 4 месеца
родител
ревизия
ad82f790c1
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  1. 2 1
      backend/open_webui/routers/tasks.py

+ 2 - 1
backend/open_webui/routers/tasks.py

@@ -186,9 +186,10 @@ async def generate_title(
     try:
         return await generate_chat_completion(request, form_data=payload, user=user)
     except Exception as e:
+        log.error("Exception occurred", exc_info=True)
         return JSONResponse(
             status_code=status.HTTP_400_BAD_REQUEST,
-            content={"detail": str(e)},
+            content={"detail": "An internal error has occurred."},
         )