소스 검색

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:
     try:
         return await generate_chat_completion(request, form_data=payload, user=user)
         return await generate_chat_completion(request, form_data=payload, user=user)
     except Exception as e:
     except Exception as e:
+        log.error("Exception occurred", exc_info=True)
         return JSONResponse(
         return JSONResponse(
             status_code=status.HTTP_400_BAD_REQUEST,
             status_code=status.HTTP_400_BAD_REQUEST,
-            content={"detail": str(e)},
+            content={"detail": "An internal error has occurred."},
         )
         )