From 73cee1316565e159e108b3511881a8b862e82262 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Boschi?= Date: Thu, 23 May 2024 12:32:47 +0200 Subject: [PATCH] backend: remove unsecure and unused endpoint /custom_component/reload (#1928) --- src/backend/base/langflow/api/v1/endpoints.py | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/backend/base/langflow/api/v1/endpoints.py b/src/backend/base/langflow/api/v1/endpoints.py index e206935c4..35ef9d617 100644 --- a/src/backend/base/langflow/api/v1/endpoints.py +++ b/src/backend/base/langflow/api/v1/endpoints.py @@ -400,23 +400,6 @@ async def custom_component( return built_frontend_node -@router.post("/custom_component/reload", status_code=HTTPStatus.OK) -async def reload_custom_component(path: str, user: User = Depends(get_current_active_user)): - from langflow.interface.custom.utils import build_custom_component_template - - try: - reader = DirectoryReader("") - valid, content = reader.process_file(path) - if not valid: - raise ValueError(content) - - extractor = CustomComponent(code=content) - frontend_node, _ = build_custom_component_template(extractor, user_id=user.id) - return frontend_node - except Exception as exc: - raise HTTPException(status_code=400, detail=str(exc)) - - @router.post("/custom_component/update", status_code=HTTPStatus.OK) async def custom_component_update( code_request: UpdateCustomComponentRequest,