From d86137b67085a8cf8e93c6b87dbbfdcd8952e6af Mon Sep 17 00:00:00 2001 From: Willy Douhard Date: Mon, 6 Jan 2025 12:44:40 +0100 Subject: [PATCH] fix: remove unused endpoint --- backend/chainlit/server.py | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/backend/chainlit/server.py b/backend/chainlit/server.py index ae0e251db2..b814d8c331 100644 --- a/backend/chainlit/server.py +++ b/backend/chainlit/server.py @@ -1209,25 +1209,6 @@ async def get_file( raise HTTPException(status_code=404, detail="File not found") -@router.get("/files/{filename:path}") -async def serve_file( - filename: str, - current_user: UserParam, -): - """Serve a file from the local filesystem.""" - - base_path = Path(config.project.local_fs_path).resolve() - file_path = (base_path / filename).resolve() - - if not is_path_inside(file_path, base_path): - raise HTTPException(status_code=400, detail="Invalid filename") - - if file_path.is_file(): - return FileResponse(file_path) - else: - raise HTTPException(status_code=404, detail="File not found") - - @router.get("/favicon") async def get_favicon(): """Get the favicon for the UI."""